Skip to content

How is weekOfYearNumber supposed to behave? #31

@vileanco

Description

@vileanco

I am wondering how is the weekOfYearNumber intended to work? It seems that it does work properly when the year changes, eg. week number can jump from 53 to 1 while day of the week is changing from Tuesday to Wednesday.

For example:

Tuesday 2019-12-31 18:00 GMT (posix 1577815200000) gives output week=53
Wednesday 2020-01-01 18:00 GMT (posix 1577901600000) gives output week=1

If I have understood correctly, there are several standards on how to calculate the week number but for example ISO week date states that "Each week's year is the Gregorian year in which the Thursday falls". So in the previous example Tuesday should also be part of week 1 of year 2020 if following the ISO week date standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions