# Multi-Day Booking system {{Solved}}

**URL:** <https://community.glideapps.com/t/multi-day-booking-system-solved/80726>\
**Category:** Ask for Help\
**Created:** [March 13, 2025, 5:03pm UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726 "2025-03-13T17:03:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![theweedyburton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theweedyburton/32/81109_2.png) [@theweedyburton](https://community.glideapps.com/u/theweedyburton)\
**Post date:** [March 13, 2025, 5:03pm UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/1 "2025-03-13T17:03:02Z")

</div>

Hi all, I have built 2 different booking systems that works perfectly fine in their own respect. It books different services on a day and blocks out times that are selected.

I now have a request to build an app for a camping ground to do their bookings. Customers would typically choose a stand and the From-To Date, I am finding it impossible to get a solutions where I get an array built with the values starting with the From Date and ending with the To Date.

I have used up my tokens on ChatGPT and Groq for 4 days straight and cannot get a snippet of formula that can generate such an Array.

Any pointers?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [March 13, 2025, 5:36pm UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/2 "2025-03-13T17:36:02Z")

</div>

You might want to use JavaScript column and a snippet from this Stack Overflow post:

> <https://stackoverflow.com/questions/4413590/javascript-get-array-of-dates-between-2-dates>

You would be able to set the start date column and the end date column as p1 and p2 in the JS column to return an array of dates.

---

<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:** [March 13, 2025, 11:36pm UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/3 "2025-03-13T23:36:24Z")

</div>

Is this solely for preventing duplicate bookings?

---

<div class="post-metadata">

**Author:** ![theweedyburton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theweedyburton/32/81109_2.png) [@theweedyburton](https://community.glideapps.com/u/theweedyburton)\
**Post date:** [March 14, 2025, 6:12am UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/4 "2025-03-14T06:12:43Z")

</div>

Yes, If you have a beter solution to prevent duplicate bookings, please share.

---

<div class="post-metadata">

**Author:** ![theweedyburton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theweedyburton/32/81109_2.png) [@theweedyburton](https://community.glideapps.com/u/theweedyburton)\
**Post date:** [March 14, 2025, 6:26am UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/5 "2025-03-14T06:26:16Z")

</div>

I managed to get the correct output by modifying one of the snippets a bit. You have to make sure to use a FORMAT DATE column to format the date to this:  
yyyy-MM-dd

Then I modified one of the snippets a bit, and this gave me the right output of all the days in an array.

function getDaysArray(start, end) {  
let arr = ;  
let dt = new Date(start);

```
while (dt <= end) {
    arr.push(new Date(dt)); // Push each date into the array
    dt.setDate(dt.getDate() + 1); // Move to the next day
}

return arr;

```

}

// Use the function  
const daylist = getDaysArray(new Date(p1), new Date(p2));  
return daylist.map(v =\> v.toISOString().slice(0, 10)).join(“|”);  
// Returns as “2018-05-01|2018-05-02|…”

---

<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:** [March 14, 2025, 6:54am UTC](https://community.glideapps.com/t/multi-day-booking-system-solved/80726/6 "2025-03-14T06:54:17Z")

</div>

> [@theweedyburton](#):
>
> make sure to use a FORMAT DATE column to format the date to this:  
> yyyy-MM-dd

Be careful with that. The format date column has been known to give inconsistent results on different devices and in different regions. Some of us don’t trust it, and try to avoid it altogether. A more reliable approach is to use a Math column:

```auto
Year(Date)*10^4
+Month(Date)*10^2
+Day(Date)

```
