Hi, I’m trying to create a food delivery app, but I’m having some issues with creating time slots, without creating a database with every conceivable time. If anyone can help that’d be awesome
I’d like customers to be able to select from a list of timeslots at 10-minute intervals.
There should be a maximum number of orders in each time slot.
Time slots in the past shouldn’t be available
Time slots should only be for times the store is open.
@Yongki I understand that you’re pretty good with timeslots. Any chance you’ve got any advice?
Timestamp,
Integerise days, months and year
Integerise time hours
Integerise time minutes
Number of ms since the epoch
Number of mins since epoch
Number of hours since epoch
You can use Adalos maths functions to integerise the time on the fly, or you can make an API call to do it on the fly from a time API.
If you’re doing it as a one off then you can just upload a spreadsheet to Adalos database with all of it worked out in advance.
This should allow you to do all manner of maths with dates that you can’t do with Adalos built in functions.
As for max no of concurrent orders, you can keep that against the slot and deduct when an order is placed for that slot or creates 4 slots and display to the user.
For the opening hours, you can store the opening hours (times) in the same format as the integerised times above and then you can easily compare the two.