Week numbers (Notion)

Uit De Vliegende Brigade
(Doorverwezen vanaf Weeknumbers (Notion))
Naar navigatie springen Naar zoeken springen

How to get weeknumbers in Notion? Especially those like what Google Calendar and my Linux workstation use?

General

The usual system for numbering weeks, is the ISO week date and is incorporated in ISO 8601:

  • The week begins on Monday
  • The week number is associated with the year that falls on Thursday in that week.

Examples [1]:

  • Week 1 of 2015 (2015W01 in ISO notation) started on Monday, 29 December 2014 and ended on Sunday, 4 January 2015, because 1 January 2015 fell on Thursday.
  • Week 1 of 2021 (2021W01 in ISO notation) started on Monday, 4 January 2021 and ended on Sunday, 10 January 2021, because 1 January 2021 fell on Friday.

Notion - The problem

The standard way to calculate week numbers in Notion, doesn't seem to be what I expected:

  • "Created time": 2022.11.20 → Wk. 46 according to my computer + Google Calendar + epochconverter.com/weeknumbers
  • formatDate(prop("Created time"), "w") → Wk. 48 - That's too numbers off!

More specifically:

  • The week starts at Saturday: 2022.11.19 → wk 47; 2022.11.20 → wk 48. Additionally, there is number off
  • Saturday 2022.01.01 is in Notion wk 1. It should be wk 52/53 of the previous year - That's why the numbers is off by two
  • Monday 2022.01.03 is the beginning of wk 1. In Notion, it's wk 2
  • Sunday 2022.01.09 is still wk 1. In Notion, it's wk 3
  • Monday 2022.01.10 is wk 2. In Notion it's wk 4.

Notion - The solution

Simple: Use captial 'W' in stead of 'w': formatDate(prop("Created time"), "W"):

  • Sa. 2022.01.01 → 52
  • So. 2022.01.02 → 52
  • Mo. 2022.01.03 → 1