# Validation for bookings across multiple days?

**URL:** <https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380>\
**Category:** Ask for Help\
**Created:** [September 14, 2025, 6:16am UTC](https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380 "2025-09-14T06:16:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SageCat](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sagecat/32/85273_2.png) [@SageCat](https://community.glideapps.com/u/SageCat)\
**Post date:** [September 14, 2025, 6:16am UTC](https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380/1 "2025-09-14T06:16:51Z")

</div>

Morning all. I’m writing an app that books four rooms across multiple days. Works fine so far but I’m wondering how I could check validation when try to book to ensure that the same room hasn’t been booked for the same days. To throw a spanner in the works, it is ok if the first or last day of the booking overlaps with another booking for same room (as check out could be in morning allowing another check in in afternoon). I’m not worried about times, just dates.

Eg., Room One booked from 18 Sept to 25 Sept, therefore Room One can also be booked from 25 Sept to 27 Sept, or from 16 Sept to 18 Sept.

What would be the best way to approach this? Would really appreciate a point in the right direction as I’m just not sure. 😺 I’ve looked at the Simple Booking App tutorial from Loqode (as well as a number of others) but it makes a helper table for time slots on a set day… that wouldn’t work for me because I’m not doing time slots but days.

---

<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:** [September 15, 2025, 12:27am UTC](https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380/2 "2025-09-15T00:27:00Z")

</div>

I would:

- Find a way, e.g JavaScript, to get two dates (18 Sept and 25 Sept 2025) and then return an array of dates in numeric form, not including the final date. So in this case that would be “20250918, 20250920, 20250921, 20250922, 20250923, 20250924”.
- Then, you would always have a list of dates that have been booked for a particular room through relations & joined lists.
- Convert it to an array, and then do the same conversion for a new booking attempt.
- Relate the booking attempt’s array of dates to the existing list of booked dates for a room. If a relation exists, then a booking can not be made.

---

<div class="post-metadata">

**Author:** ![SageCat](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sagecat/32/85273_2.png) [@SageCat](https://community.glideapps.com/u/SageCat)\
**Post date:** [September 15, 2025, 12:54am UTC](https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380/3 "2025-09-15T00:54:59Z")

</div>

Thanks for this. I will have a red hot crack at that 😺

---

<div class="post-metadata">

**Author:** ![SageCat](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sagecat/32/85273_2.png) [@SageCat](https://community.glideapps.com/u/SageCat)\
**Post date:** [September 16, 2025, 9:19am UTC](https://community.glideapps.com/t/validation-for-bookings-across-multiple-days/84380/4 "2025-09-16T09:19:22Z")

</div>

Hi all. I actually ended up working this out without the need for javascript. I stumbled across this post by @Darren_Murphy and after a bit of trial and error I got it working! Thanks Darren!

> [@Array of dates between 2 dates - experimental column](https://community.glideapps.com/t/array-of-dates-between-2-dates-experimental-column/52511/4):
>
> Okay, so what I would do: Write both start and end dates to user specific columns Use a pair of single value columns to apply those to all rows in your bookings table Create an if-then-else column: – If SV Start Date is after Booking End Date, then null – If SV End Date is before Booking Start Date, then null – Else true Then do a rollup on the if-then-else column, counting true values. If the result is greater than zero, then you have an overlapping date. NB. I may not have the if-then-el…
