Hello everyone, I recently know Adalo and I need help. It seems to me an excellent tool but at the moment I’m going crazy to manage the activation of orders based on the opening and closing times of the restaurant.
The need is simply to check on the basis of the current time if the restaurant accepts orders or not. If he accepts them, I can show the checkout button, otherwise a message informing the user that the restaurant is currently closed.
Two shifts are scheduled for each day: in the morning for example between 11:30 - 14:00 and in the afternoon for example between 18:00 - 23:00. The problem I find is related to the moments when the restaurant is closed: I cannot make a warning appear preventing the order from being placed.
Is there anyone who has managed this problem and can help me? Any kind of help is welcome!
Date & Time > Current Time - Date & Time > Start of Today × 24
This will give you the hour of the current time, and you can probably use this to determine whether it’s within the range of the open hours. It might be a little tedious, but let me know if you have any luck!
Thanks @jeremy , I have tried to manage this problem in all possible ways but I doubt that it is currently feasible. It’s a shame. However I will try as you recommended.
Alternatively, I could manage the matter in another way: the venue is always open, but I have time slots (like simple strings 12:00 - 12:30, 13: 00-13: 30 etc …) and I must user to select at least one.
Hi @karimoo , thanks for the explanation !! You are a great !!
I started implementing the solution using your advice.
From what I have verified, the decimal value that corresponds to the time varies from day to day. This means that 10:00 AM on 20/06/2020 have a decimal value different from 10:00 AM on 21/06/2020 for example.
This means that I should upload the annual calendar. It is not feasible. My idea is to have a collection that welcomes the day of the week and the opening hours:
day - start fraction - end fraction - venue
Monday - 12:15 PM (in decimal value) - 12:45 PM (in decimal value) - Venue X
Monday - 12:30 PM (in decimal value) - 13:00 PM (in decimal value) - Venue X
In this way, based on the user’s day and time of entry, I would be able to extract the times for that day of opening and closing.
The problem I have now is that the hourly time (in decimal value) is different for each record because I cannot represent the start and end times with a fixed numeric value. Uploading the entire annual calendar is unthinkable.
I hope I explained myself.
Do you have any suggestions?
@stffnc1974 Hi Francesco, that is a strange thing.
I looked into it by creating some records saving Date & Time with the Date Picker and updating a number field with the formula to calculate the time fraction:
I could not find a difference in the time fraction for different days here.
At the beginning of the testing using the date picker in the preview, I once could create a different value as you described in the database table view. Unfortunately, I did not take a screenshot.
I tried to reproduce it but did not happen again.
The only explanation I have is that somehow a different value was saved to the database table. The calculation is working fine, but there might be a problem with the date picker - at least in the previewer.
Thanks @karimoo for your availability !! I checked again, in fact the problem is the Date Picker component (maybe the milleseconds that are not visible affect). To have time slots with 15 minute intervals, I have to dynamically add the minutes to the starting time. I noticed that the “time fraction” decimal value remains the same, regardless of the day, if the date and time value of the initial date picker component remains unchanged.
If you change the value of the date picker by one hour then it generates different decimal values!?!?
So as I solved, I keep the value of the date picker fixed and add the minutes up to the occurrence for a day of the week. Then I extract the csv file, add the other days of the week keeping the time fraction decimal values calculated previously. Then I upload the file with the remaining days into the collection.
A very tricky procedure but I think it is the fastest and most efficient way.
Thanks again for your help and for your kindness. @karimoo… you are the best!