"Date" or "Date Range" field type, which one would YOU use?

I want a “Reservation” thing being created and a field that would save the dates involved, those dates come from 2 Dates, Check-In and Check-Out dates.

What type of field would i use to save those dates including those in between?

  1. DATE FIELD, + THIS FIELD IS A LIST, and do an expression while saving: take those 2 dates, and save also the dates in between (which i’m not sure the exact expression to use).

OR

  1. DATE RANGE FIELD, and do an expression while saving: take those 2 dates as start and end dates

Unfortunately, date ranges have some sorting and filtering limitations.

I’d choose option 1 but change it up a little. Fields:

‘Start Time’ [date]
‘End Time’ [date]
‘Duration (seconds)’ [number]

This way, you have a lot more flexibility and if a reservation is changed, it’s easy to change these values.

Hope this helps,
Daniel

1 Like

thanks, so your’re saying i should actually use 2 date fields in the database for start and end dates, and not save the dates in between.

What is the “Duration” for?

Exactly. And the duration is just a bonus. It would make it easier to calculate how long the reservation has been going on for. To get the duration, you want to do the following:

End Time extract UNIX timestamp - Start Time extract UNIX timestamp / 1000

2 Likes

Personally, If the date range would work as it should, I would pick it since it is more convenient.
However, the implementation of the date range is not good enough for now, especially for sorting and filtering.
I would thus choose the solution proposed by dbevan, and use the duration field only if you plan to sort or filter on that field.

1 Like

Hi,

can you explain how do you implement this? I believe I have a similar problem but not sure how to create the expressions or this field is a list.

I need to create a list of dates: all the days of month selected in a dropdown menu (Select Month/Year).
This list can be a temporary list just for visualization or can be stored in a list of Dates.

I was wondering if I can obtain this by using List Item Expression, or combined with List of Numbers… or some plugin like that…

2 Likes

Hi,

I am also trying to implement something like this although more basic - I think.

I would like to enter school holidays into a calendar. This means I need to block ranges out in the calendar (air daytime/time picker). This means I need to see all the days.

@dbevan - I am where you are describing with the fields I just have no idea how to create to logic to make the magic happen.

If I’m not mistaken, the Air DatePicker allows you to block multiple dates.

I would create a new database table named “School Holiday”. The only necessary field is a “List of Dates”. This field will contain every date that the Holiday covers.

Manually add all of the Holidays.

Then in the Air DatePicker’s settings, find “Block Dates”. The expression you need to enter will be something like:

“Search for School Holiday’s List of Dates”

This should work perfectly.

He,

Thanks for responding so quickly.

So … If i add a holiday that the start date is the 2nd of sept and ends the 7th September. Could I add on date in and the whole period is booked? or would i have to go in each day in that time period to book the event daily?

I also cannot find the feature to block dates. Sorry I am a beginner. It is probably completely obvious!

Just follow everything I said in the previous message and you should be fine. If you have questions directly related to a step, let me know.

Block Dates is at the bottom of this image.

Hi,

I have started.

Here is the data table - in calendar constraints.

image

I have created a list of School holidays. Now I am trying to save multiple fields to one list. Will that work?

image

I have also looked for the function to block days - I do not have it.

Capture%201

Should do. As long as it’s a list of dates.

  1. Make sure it’s the Air DatePicker. 2. Make sure it’s the most recent version (go to the plugin’s tab)

Hey,

So it was not a list of dates. I have update the data table and still this and the workflow but still no entries into the data base let alone display in the calendar.

I have version 2.8 of the calendar which I believe is the most up to date version. THis is what the workflow is looking like.

image

I have made progress.

I have now found the feature to save a range of dates with one Air/picker. I Just cannot get the data to save in the list of dates? I have one data type which is “date” and another “date range” Neither will work.

I have been reading this: you all skip over the basics of how to actually save the dates. I know that means I am basic but if you could dumb it down to basic so i can see how the logic is supposed to work i would be in your debt.

Thsi is what I am working on: