Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Date of the Week #53

Closed
repsajanboy opened this issue Oct 3, 2020 · 3 comments
Closed

First Date of the Week #53

repsajanboy opened this issue Oct 3, 2020 · 3 comments
Labels
T: Feature Type: :tada: New Features

Comments

@repsajanboy
Copy link

Hi guys, been using your package and it so great, it help me achieve a certain task that needed to be done. Just want to ask if there a way to get the first date of the week in the calendar. Example, im implementing VisibleRange.week(), and initialDate is LocalDate.today() I needed to get the value of the first day of the week, like now October 3-9, 2020 is visible in my timetable so i needed to get Oct. 3, 2020 and then when I scroll horizontally to next week the timetable will now display Oct. 10 - 16, 2020 and now I needed to get the value of Oct 10. is it possible?

@repsajanboy repsajanboy added the T: Feature Type: :tada: New Features label Oct 3, 2020
@IoanaAlexandru
Copy link

TimetableController has a getter named currentlyVisibleDates which does what you want. Just call controller.currentlyVisibleDates.start to get the first day of the currently visible week!

@repsajanboy
Copy link
Author

Yes, thank you I managed to got it, what is the correct way to format LocalDate? Because now I am getting a return value of Saturday, 03 October 2020, and what i need is 10/3/2020. thanks in advance

@IoanaAlexandru
Copy link

Check out LocalDate's toString method. You can provide it with a pattern. I think you need something like date.toString('MM/dd/yyyy'). You can read more in the Noda time documentation, which the time_machine package is based on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Feature Type: :tada: New Features
Projects
None yet
Development

No branches or pull requests

2 participants