[Extended DateTime] Week Number action missing corresponding Year

Forge Component
Published on 2019-08-08 by Caio Santana Magalhães
8 votes
Published on 2019-08-08 by Caio Santana Magalhães

According to ISO-8601, the date 2018-12-31 must correspond to the year/week: 2019/01.

- input year: 2018
- output year: 2019

The WeekNumber action doesn't comply.

Any solution/suggestion?


Hi Pecenin,

Are you trying to detect whether a given week number starts in a year and ends in the following year? I believe adding a Year output to the WeekNumber action would be a breaking change since this action is currently set as Function.

Also please notice that the behavior of the WeekNumber function changes by adjusting the WeekRule and FirstDayOfWeek input parameters.


Hi Caio,

I need to know the week and year, from a date, as defined in ISO-8601 (week start in monday, 4 days).
But, as illustrated above, the week year (2019/01) may be different from the input date (2018-12-31).
Actually, I believe a WeekNumber action without returning year, doesn't make sense.

Also, note that using action StartOfWeek, we get:
- StartOfWeek(2018/53) --> 2018-12-31
- StartOfWeek(2019/01) --> 2018-12-31
Two different weeks starts in the same date. This is not expected, actually, the week "2018/53" doesn't exist. So, the action WeekNumber is expected to return 2019/01 for the date 2018-12-31.

Maybe, to avoid a breaking change, a "WeekNumber2" could be considered, outputing year and week, as ISO-8601.