-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weirdness in week calculations. #21
Comments
The
Please note that January 4th is always in the first week and the week based year does not deviate from the calendar year:
Time::Moment is in agreement with Date::ISO8601:
The Wikipedia article ISO week date goes into further details. |
I am aware the first week of the year can occur in a different calendar year under ISO . The confusion pertains to week turning up a whole 50+ weeks earlier than expected in 2016 and 2017 I'm guessing this is of course dependent on the fact
But I'm still not sure where its going wrong. It would probably be more obvious to allow |
The reason it's 50+ weeks earlier in 2016 and 2017 is because the calendar date is the last week of the week based year (of the previous calendar year): 2016-01-01 | 2015-W53-5 To construct an instance of Time::Moment set to Monday of the first week of the given week based year:
To construct an instance of Time::Moment set to Monday of the 25th week of the given week based year:
|
Seems 2016 and 2017 have some issues.
The first week of 2016 really shouldn't be in Jan 2015 ...
The first week of 2017 really shouldn't be in Jan 2016 ... esp not around Jan 10 ...
Seems off by a year for the whole year
Also disagrees with Date::ISO8601
The text was updated successfully, but these errors were encountered: