Open Now versus Closed Now Display

In order to make it so a text will display open or close based on current time and the stores operating hours, you will need to have the database structured to have field values of hour as a number and minutes as a number and the day of the week as a number. You will need it for both open and close as some stores will open on Monday but close in the early AM on Tuesday.

Then on page will need some groups for calculating purposes.

Screen Shot 2023-04-24 at 12.53.25 PM

The Open Date and Close date groups have data type set to date and are taking current date/time and using the change operators to create a ‘current day open time and close time’.

For Open date it is straightforward, but for close you need some conditionals to check if the open day and close day of week are the same.

Screen Shot 2023-04-24 at 12.55.45 PM

Then group range creates a range using the open and close groups dates

Screen Shot 2023-04-24 at 12.56.12 PM

Then need a group to hold onto the current days ‘operating hours’ (in my database I have a data type called operating hours that has the necessary fields of close hour, minute and day etc)

Important to match the open day to the current date time day value.

Then on the text field to show open versus close need a conditional

Screen Shot 2023-04-24 at 12.57.55 PM

While the main text is just Closed Now with red font

Hope this helps…it will help me for my reference purposes.