Hide element between 9:00 pm and 7:00 am

Hi, im try to hide a button when the current time of the user be after 9pm and show again after 7am.

I know in “change visibility” I can select date/time but just in relative mode, I can set a specific time.

Some know how is this posible?

Hi @Maxiogas ,

My take would be,

create tmp variable in users collection to save fraction, which contains time,

Initialize switch input field that can be hidden later,

In the related screen (or you can put when button pressed), you can update tmp variable and input field,

And use that input field (switch) to change visibility,

The fraction value depends on your timezone, for me I have to decrease by 7, so 7 am means 1, 9 pm means (12+9-7)/24 = 0.58333333

If your timezone resulting the fraction to have 2 range numbers, you need to have 2 change input value too.

Here is the cloneable app.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.