Filtering based on time of day and day of week

Hello!
I would like to show a component only during weekdays (M-F) from 11:00 to 19:00.
I was thinking of doing the calculations directly in my Gsheet but am worried of refresh times (although it is a PRO app).

How would you tackle this?

Thanks a ton!
Mathieu

I’m thinking you can use two columns to address this.

A math column: WEEKDAY(N) with N being the Now value to get the Weekday (1 is Sunday, 2 is Monday, etc.)

A math column: HOUR(N) being the Now value to get the current hour.

Show components when Weekday is not 6 and Weekday is not 7 and Hour is greater than 10 and Hour is less than 20.

3 Likes

Magnificent @ThinhDinh, thanks a million
Does NOW take the user’s timezone? Is it possible to force a timezone?
The use case is that I only want to let users sell when the financial market is open!

image

Now() will reflect the local time of the users device. If you want to make adjustments for timezone, then you’d need to first know the users timezone (or GMT offset), and then factor that into the calculations.

2 Likes

Very clear, thanks @Darren_Murphy !
I will assume that they all have their devices set to France then :slight_smile:

Have a great day

1 Like