Weeknum() starting on Monday

Hello to everyone. Thanks in advance for your support. Here is my doubt:

I’m using this formula: and(weeknum(now()) >= weeknum({Inicio}),weeknum(now()) <= weeknum({Fin})) to see if an event is “active” and create different views with that filter. The thing is that the formula is using Sunday as the starting day and I want to use Monday, because is the starting weekday in Spain.

How can I solve that? In Airtable I can make this: DATETIME_FORMAT(SET_TIMEZONE({Inicio}, ‘Europe/Madrid’)

Something similar here?

Thanks again.

Hi.

Have a look at the formula reference: Formula Reference - SeaTable
It’s as easy as it can be: weeknum(‘2020-01-12’, 11)

Hi, thanks for your reply!

I’m actually using that formula, but it is not working.

Screenshot_91

In the column “SEMANA INICIO” I’m using this formula: weeknum({Inicio}, 11), and as you can see in the red rectangle the actual week is 25 (16/06/2023) and the event week should be (18/06/2023), but it is counting it as the next week (26), because is Sunday.

Is something wrong?

1 Like

Yeah, I see. weeknum uses the information of the first week of the year. Even if the 31th of december is a Saturday it will be count as week one of the year. The function isoweeknum instead recognizes it as week 52, so it is the 1st on the Sunday.

You should use isoweeknum.

Yes!! It works with that formula!

I don’t fully understand the difference between ISO and not ISO week counting, but works.

Thanks again.

Very good.

Yeah, if you wanna read more about it you can find alot information on wikipedia: ISO week date - Wikipedia
Or here a comparison: How Do Week Numbers Work?

:slight_smile:

1 Like

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