Could someone help me on how to make the premises appear open or closed if the hours are from Monday to Friday 9:00 a.m. to 3:00 p.m. and 5:00 p.m. to 9:00 p.m. Sunday CLOSED
Does this need to be dynamic for multiple different businesses, or is this specificly for one business with those specific hours? Are there any Saturday hours?
Thereâs several ways to handle this depending on how flexible you need it to be, or if the days and times would ever change. What I show below is maintainable, but may take a little bit to fully understand it and how the IF column works. But in itâs simplest (least amount of columns) form, I would do it like this. It could be changed to make it easier to understand, but it would take a few more columns to build it out.
First I would create a math column to figure out the current weekday number:
Finally I would create an IF column to use those values to determine if the business is open or closed. Keep in mind that this is based on the current date and time of the current userâs local timezone:
What I do here is first check if the weekday is 1 (meaning Sunday), then return Closed.
Next I check if the hour is before 9:00, then return Closed so we eliminate any hours less than 9.
Next I check if the hour is on or after 21:00, then return Closed so we eliminate any hours greater than or equal to 21.
Next I check if the hour is before 15:00, then return Open since any remaining unchecked hours prior to 15:00 on Monday through Saturday are Open.
Next I check if the weekday is 7 (meaning Saturday), then return Closed because the only hours left to check are between 15 and 21 and Saturday is closed during that time.
Finally I check if the hour is on or after 17:00, then return Open because all thatâs left to check are the times between 17 and 21 on Monday through Friday.
Anything between 15:00 and 17:00 will fall into the ELSE and return Closed.
Thanks a lot. for your great help but I have a problem I donât know if itâs because I live in Spain but it tells me that the week is 1 and I should put it as 7 since right now itâs Sunday
I show you capture
I do not know what I do badly
Here I leave you how I put it and thank you very much
This depends on your audience and their time zone. I gave up on using Glide to manage on-off times, so I moved to Integromat to push a âis-closedâ value on a scheduled basis to the app. I could not reliably use Glide time⌠as every device things it has the âcorrect timeâ for math, etc.
Easy to use - and you can do a lot of stuff for free too. It is a no-code backend.
My scenario for opening and closing is based on the following âscenarioâ
opening hour module - runs at a specific time (open!) - and it updates a row in a Google Sheet âtoggle-openâ kind of thing. The Google Sheet is used by the Glide app for visibility
and closed is the same
So very quick to do. Doing it in Glide took hours and hours, and there were too many cases when the user device did not pick up the right time, etc. This way is automated and easy