# Rolling Calendar Availability

**URL:** <https://community.glideapps.com/t/rolling-calendar-availability/62437>\
**Category:** Ask for Help\
**Created:** [June 4, 2023, 6:07pm UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437 "2023-06-04T18:07:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pietro\_Castellani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pietro_castellani/32/59938_2.png) [@Pietro\_Castellani](https://community.glideapps.com/u/Pietro_Castellani)\
**Post date:** [June 4, 2023, 6:07pm UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/1 "2023-06-04T18:07:39Z")

</div>

Good morning,

I’m developing an appointment booking app and I want the professionals to have 1 month in advance calendar with the timetable of their availability.  
At the same time the users should have the chance to book within these constraints.

How can i set the rolling calendar up? Namely, how do I set up a 1 month from now table with rolling dates where each row is “today +1” until row 30? They should then be dates as I want to know the day of the week and so on…

Thanks for replying and I hope to have been clear enough

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 4, 2023, 11:34pm UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/2 "2023-06-04T23:34:07Z")

</div>

Taking the constraints and availability out of the question, we will discuss about this first:

> [@Pietro\_Castellani](#):
>
> Namely, how do I set up a 1 month from now table with rolling dates where each row is “today +1” until row 30? They should then be dates as I want to know the day of the week and so on…

- Create a new “Helper Table”
- Add 29 rows so it would have 30 rows.
- Create a rowID column.
- Create a lookup column and target the whole rowID column above.
- Use the column type “Find Element Index”, with the input being the lookup column above as an array, and the element to find being the rowID of each row. Then you’ve got the index of each row.
- Finally, add a Math column with the formula:

N-HOUR(N)/24-MINUTE(N)/24/60-SECOND(N)/24/60/60+I+1

Edit: Sorry, forgot to explain here. N stands for the “Now” value, I would correspond to the index value.

This will give you a rolling count of “today + 1” at exactly 12AM.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/1/21a7fd8b24d2b760d47e4cc4ee6419d0dbc4c95a.jpeg)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 4, 2023, 11:59pm UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/3 "2023-06-04T23:59:04Z")

</div>

Nice summary, @ThinhDinh.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 5, 2023, 1:01am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/4 "2023-06-05T01:01:50Z")

</div>

> [@ThinhDinh](#):
>
> N-HOUR(N)/24-MINUTE(N)/24/60-SECOND(N)/24/60/60+I+1

What’s that “`I`” do in that formula? Is that a typo?

> [@ThinhDinh](#):
>
> This will give you a rolling count of “today + 1” at exactly 12AM.

Not quite _exactly_, right? Because it doesn’t remove the milliseconds component from Now. Not an issue for the majority of use cases, but I got bitten by it once.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 5, 2023, 1:13am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/5 "2023-06-05T01:13:04Z")

</div>

That I is the index, so you got today plus index plus 1 and so on.

Is there a way to remove the milliseconds as well?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 5, 2023, 1:18am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/6 "2023-06-05T01:18:11Z")

</div>

> [@ThinhDinh](#):
>
> That I is the index, so you got today plus index plus 1 and so on.

ah right, sorry I missed that 🤦‍♂️

> [@ThinhDinh](#):
>
> Is there a way to remove the milliseconds as well?

Not that I’m aware of. @Jeff_Hager once suggested that it might be possible, but I haven’t found a way to do it…

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 5, 2023, 4:25am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/7 "2023-06-05T04:25:08Z")

</div>

I think this was the best solution I had come up with.

> [@Today and 14 days ahead](https://community.glideapps.com/t/today-and-14-days-ahead/57669/25):
>
> Yes, that is definitely true, and Trunc(Now) is essentially the date at midnight, but the result for today is 44966 which can be converted back to a normal date in Google, but there is no function in Glide to convert it back to a date. 44966 is the number of days since Dec 30th 1899. That’s not a number that’s useful for me to subtract a few hours. I guess an easier alternative would be to set the seed date to Dec 30th 1899 at midnight and then change the math column to seed+TRUNC(now). Pro…

---

<div class="post-metadata">

**Author:** ![Pietro\_Castellani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pietro_castellani/32/59938_2.png) [@Pietro\_Castellani](https://community.glideapps.com/u/Pietro_Castellani)\
**Post date:** [June 5, 2023, 10:36am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/8 "2023-06-05T10:36:45Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Jeppeh](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jeppeh](https://community.glideapps.com/u/Jeppeh)\
**Post date:** [June 26, 2024, 7:09pm UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/9 "2024-06-26T19:09:38Z")

</div>

@Pietro\_Castellaniand @Darren_Murphy @ThinhDinh Hey guys! how did you get this to work as a rolling calendar for booking appointments?  
Since row nr 1 always will be today, the booking will after midnight come on wrong date. Should I build another table for the bookings?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 27, 2024, 1:39am UTC](https://community.glideapps.com/t/rolling-calendar-availability/62437/10 "2024-06-27T01:39:33Z")

</div>

> [@Jeppeh](#):
>
> Since row nr 1 always will be today, the booking will after midnight come on wrong date.

Can you show me how it would be the wrong date after midnight? The helper table only serves as a temporary store to calculate the days dynamically. You should write the days to the bookings table in your form.
