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

Question: Is there an easy way to get ShownDates (plural) from the calendar #53

Open
InquisitorJax opened this issue Apr 16, 2024 · 3 comments

Comments

@InquisitorJax
Copy link

Requirement:
I'm binding events to data which is fetched from an api - so when month or week view is changed - or I change from week view to month view at runtime, I need to fetch new data based on the range of dates that are shown in the calendar.
so

  • is there a way to easily determine the date range currently shown on the calendar (or do I have to deduce this from CalendarLayout and ShownDate property?
  • is listening to the ShownDate property change the best way to detect that the calendar layout or left/right week/month view has changed?
@yurkinh
Copy link
Owner

yurkinh commented Apr 17, 2024

Hi @InquisitorJax

  1. There is SelectedDates property. Check please RangeSelectionPage
  2. ShowDate or PrevLayoutUnitCommand, NextLayoutUnitCommand, SwipeLeftCommand, SwipeRightCommand

@InquisitorJax
Copy link
Author

I think perhaps you misunderstand slightly
for example - if I'm viewing the calendar in month view of april, then would be handy to access a property like VisibleStartDate and VisibleEndDate - which would be Apr 1 - Apr 30. ie what are all the dates my user is looking at - so I know I need to fetch data for that date range. This is something different to date selection.
So if there aren't properties like above to know this, I guess one can derive the visible dates from SelectedDate + CalendarLayout properties.

I guess ShownDate property change is also the best way to handle submitting a new query for the dates the user is seeing?
So if the user does any user action that changes the visible dates (like via any of the commands above) - I need to submit a new query to fetch data for all the dates they can see.

@yurkinh
Copy link
Owner

yurkinh commented Apr 22, 2024

Currently, there is no specific property for that hence if you can achieve results with ShownDate then use it. I will think about how to simplify this with next versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants