How do I make a button visible only during certain hours of the day?

I am working on a Covid-19 tracking app for a school and they need to make sure that they collect their information per CDC guidelines 2 hours or less before school opens.

My App currently has a button that allows them to enter information and I think the easiest way to facilitate this would be to have the button only visible starting from a certain time. What is the best way to introduce a visibility condition to hide the button when it does not fall within a selected time frame during the day?

Could get a bit creative…Create a math column in the data editor to add the hour and minutes of the current time (hour(now)*100+minutes(now)). This would result in something like 730 for 7:30 or 1105 for 11:05.

Then, only show the button when that value falls within the range you’re looking for. for example, "Show when [math column] is greater than 530
AND
show when [math column] is less than 730"

if you only wanted to show the button between 5:30 and 7:30 am.

4 Likes

Wonderful solution to use the math column. I did it and only needed to grab the current hour given I don’t need that much precision.

Do you know if the time is localized to the location of the user that is logged in or localized to the spreadsheet that serves as the data source?

I always forget the answer to this question. My gut tells me local.

1 Like

Time is localized to the user. Any column that’s not a basic column (so any computed column) is computed directly on the user’s device. This includes any date calculations that use ‘Now’, so it will always be the local user’s time.

1 Like