I Need A Way To List All Dates Between Start Date And End Date To Eliminate Double Booking Someone For The Same Spot During That Time
Anyone Know How To Do This
I Need A Way To List All Dates Between Start Date And End Date To Eliminate Double Booking Someone For The Same Spot During That Time
Anyone Know How To Do This
I would do it like this (I don’t like working directly with dates in JS, I want to convert it to numbers first).
return Array.from(
{ length: p2 - p1 + 1 },
(_, i) => p1 + i
).join(', ');
Then, when there’s a new booking, you also convert it to this “difference” format and check against the existing list of numbers to prevent double booking.
I have a template called Simple 1 Person Booking Solution that you can start with.
This Helps So Much,Thank You