Time challenge

Hello Gliders!

I have been trying to solve a time/date issue for some time now, and instead of banging my head against the wall, why not ask the community :slight_smile:

This is my challenge:

I have a restaurant where they present their opening hours in my Glide Page.
The opening hours are stored in it’s own table containing separate columns for weekday, opening-time and closing-time, and the restaurant owner can edit this data at any time.

To show the opening hours is not the problem, but I want to be more interactive.

I want the customer to see instantly on the first page if the restaurant is open or closed at the moment, and if they are open, also show the closing time, and if they are closed, show the next opening time.

Something like

“We are OPEN today until 21:00”
“We are CLOSED at the moment but will open again on monday at 10:00”

And also be able to show another text if there is less than one hour before closing time, like:
We are closing for the day in X minutes. (Like it says in Google My Business, 1 hour before closing)

The thing is that it’s the user table that is used as data-source for the Homepage of the restaurant, so any data about time must be fetched from the opening hours table with relation/lookup or something else (query…)

Does anyone have any general idea of how to approach this challenge?

THX in advance.

Cheers Måns

I made a concept App last year that does most of this. Below is a loom video where I walk through how I made it.

1 Like

THX a lot @Darren_Murphy, I am very impressed !

This was a lot more complex that all the things I have played around with, and Javascript is nothing I master, so any simpler solution would be really nice, also based on the time of day instead of pushing choice buttons.

Yes, the choice buttons were just there to demonstrate the concept.
To base everything on the current time of the day, you simply replace those (and the associated user specific columns) with a Math column that returns the current time. (Now).

If you can show me some screen shots (from the Glide Data Editor) of how your data is currently structured, I might be able to offer a few pointers.