Calendar Calculations and Availability

I searched through the forum for info but I couldn’t really find a straight answer.

I am trying to calculate the number of days between two date inputs. I am aware of the “range” feature but I couldn’t figure out how to calculate how many days are in that range.

To add to that question, I am trying to figure out a way that when a listing is booked, those dates become disabled on the date picker inputs for future bookings, marking the listing as unavailable for those dates.

Does anyone have any experience with this?

To get the number of days between two dates, you can subtract the start date from the end date and format the result as days.

If you are using the Air Date/Time Picker plugin, you can block dates based on certain criteria. So, I’m thinking you could search through your listings and block the dates that have already been saved.

Hope this info helps to get you down a good path.

Best…
Mike

Thank you, that did work initially.

The problem is that it is giving me half days, which I’m guessing has to do with the time input even though the input is only capturing date. Is there any way to just capture date with this field and not time?

When you save the date, you can change hours, minutes, and seconds (each individually) to 0. See if that does the trick for you.

Best…
Mike

At what point in the equation can I do that? Right now I have it set up as seen below, but it only lets me change the hours, minutes, seconds, for the first value in the equation:

Bubble4

Yeah, I think I remember that now. I believe when you change the hours, minutes, and seconds to 0 on the first date, it just works. Does it appear to be working correctly for you?

It was still giving me the half days when I did it like that. But I did have the initial content on the Date Picker set to Current Date/Time, so I just changed hours to 0 in that section and it appears to work. Thanks for the help.

This topic was automatically closed after 70 days. New replies are no longer allowed.