Save date as a date or as a text

Goodmorning everyone . I am faced with the following question.
I give my clients the ability to create certain menus with a validity range (currently it’s just a valid date
valid from December 16th to December 24th, for example. )
I would also like to add an hourly validity range.
That is, this menu is valid from 16 to 24 December from 08:00 to 17:00, so I would like that every day after 17:00 that menu disappeared from the part where the customer can buy.
To do this I thought of using 4 time-pickers (2 only for the date and 2 only for the time) and save 4 element in db (init_day , final_day , init_hour, final_hour).
Now I have seen that saving the data in the bubble db in “date” format, the day and time on all 4 fields in my db are added to me anyway and this does not allow me to make comparisons with the dates correctly. Since placing the constraint in the “do-search-for”
Init_day >= current date time (he also picks me up the time, and the same goes for the data saved only as now).
At this point I wonder, would it be appropriate to save the time-picker data as text? But then how can I compare with the current date?
I don’t know if I have fully explained, I hope someone can help me. Thanks in advance

I’m not sure if I 100% understand but have you tried using the Date & Time input?

You can then use DateTime functionality in the conditions…

unfortunately in this way I would not get the desired result. If you select from only one time picker Date & time
then my initial_date field would be, for example,
17/12/2020 08:00
and final_date would be
24/12/2020 17:00.
You understand well that in the intermediate days between 18 and 23 the menu would be available in all time slots, because rightly I say let me see only those that fall within the interval I have chosen, that’s why I need an interval that intercepts only the time, so that an additional condition can be applied

This topic was automatically closed after 70 days. New replies are no longer allowed.