-
Hi, I use import { format } from 'date-fns';
format(new Date(2019, 11, 30), 'yyyy-ww');
// 2019-01 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This behavior is correct. Indeed, Monday 30th December 2019 is a Monday, the first Monday of the first week of 2020. You can see more here : http://week-number.net/calendar-with-week-numbers-2019.html I have tried with these values : new Date(2019, 11, 28) // Saturday -> output 52
new Date(2019, 11, 29) // Sunday -> output 52 if first day of week is set to Monday, otherwise by default (Sunday) output is 01
new Date(2019, 11, 30) // Monday -> output 01
new Date(2019, 11, 31) // Tuesday -> output 01 |
Beta Was this translation helpful? Give feedback.
-
@kossnocorp Could you please check this issue? |
Beta Was this translation helpful? Give feedback.
-
@wenqi73 @SoniaLahi did answer your question (thanks, Sonia!). You maybe want to use ISO-week numbering If you actually need
|
Beta Was this translation helpful? Give feedback.
This behavior is correct. Indeed, Monday 30th December 2019 is a Monday, the first Monday of the first week of 2020.
You can see more here : http://week-number.net/calendar-with-week-numbers-2019.html
I have tried with these values :