@stffnc1974 @jeremy I just created a post on how to work with time calculations.
First, read
If you want to compare time slots such as opening shift, you basically need to compare the decimals/fraction part of the Date&Time field.
I tried the following:
I created a Collection with two additional Number fields to store the time information for start and end:
Using a Form, I first create an entry for the shift data.
Note that there is a second action to update the calculated time fractions:
The formula basically uses the INT() function to cut off the days before the decimal point.
The entries in the database look like this:
To make the Order button only Sometimes visible I need to calculate the time fraction of the Current Time and make it available on the screen:
I used the following to test it:
First I created another Collection to store the calculated time fraction:
Holding just one record:
For multiple users, you need to link this to the User collection (I skipped this here).
Next, I added a Button to the screen AND moved the button into a list (Make List):
This list can now hold the NOW collection:
The Button has two actions:
The first one is calculating the time fraction of the current time and updating it to the collection.
The second action is linking to the target screen:
Now I have the data available to fill the fields to make the order button only visible when the current time is between the start and end of the shift:
In addition, I also calculate, how much time is left until closing:
The text label uses a Custom Formula:
which looks like this:
To get back to the minutes I have to multiply the difference with 1440 (minutes per day) and use the ROUND() function.