I’m building a boat syndication app that allows boat shareholders to book days on their boat.
Is there a quick Javascript snippet I can use to create a list of all dates between the Start and End date of the booking?
E.g.
Start 24th
End 28th
List of days between = 25th, 26th, 27th.
I’ve done this without code, but it has added quite a few columns to my table and isn’t really scalable…
I feel like there’s a short Javascript snippet of code that would solve this for me?
What’s a Helper Table?
And how would I implement it?
As for the max duration, I don’t expect a single booking to exceed 7 days, but there’s no hard limit so I wanted to build in redundancy incase someone wanted to book 2-3 weeks onboard.
Hi Darren, looks like your solution works quite well for my use-case.
Since the Start and End dates are user-specific columns on another form, I was able to simplify your solution even further by replacing the user-specific Start & End dates in the Helper table with a Single Value column that pulls from the form itself… If that makes sense?
Yep, that makes perfect sense. I was just giving you a self-contained example.
Also, you’ve probably also figured out that the first 3 columns aren’t strictly necessary. You could replace those 3 with a single Number type column, and number the rows manually. I just do it the way I showed in the video out of habit. I also think it’s a bit more elegant