Hi all, I would like to add a button to my page that when clicked takes the currently displayed date range from my Event Calendar, so I can send those dates to an API.
The user clicks “Search This Month” the server action fires to the booking provider to check availability with something like this https://api.rezdy.com/v1/availability?productCode=PXL0UZ&startTimeLocal=2021-02-29 00:00:00&endTimeLocal=2021-04-10 00:00:00&minAvailability=3
Do you think there is a way to achieve this so I can replicate what the user already has in their Bubble site? I know it’s painful but just being hopeful
I started trying things like {{calendar1.currentDates}} {{calendar1.data.values}} etc. so just hoping its hiding there somewhere.
Sorry i don’t really understand your idea.
How do you select the dates in the calendar exactly? How do you tell it the start date is 29.12.2020 and that the end date is 05.01.2021?
So what does Search This Month button do? Does it take the first displayed day and the last displayed day and send them as query params?
Or does it just load dynamic data and displays it in the calendar. Sorry, but the logic here is … weird
A Date that is the first visible day. In month view, this value is often before the 1st day of the month, because most months do not begin on the first day-of-week.
and
activeEnd
A Date that is the last visible day. Note: This value is exclusive . See how events are are parsed from a plain object for further details.
I think we can easily add them to the calendar, maybe @patrick can check this as well.
currently you can only send the dates users select in the calendar.
I think this totally makes sense from a development standpoint. The calendar query currently needs to return all events to ensure that if the user is looking at today +/- 1/5/10 years, data is displayed.
Right now, the query would need to return all that data. Once this feature is enabled, you can send the activeStart and activeEnd parameters to the query to limit the size of the output.