Skip to content

Calendars with and without a week numbering system #15

Open

Description

This discussion was prompted by tc39/proposal-temporal#2744.

The ISO 8601 calendar has an official, well-specified week numbering system. The Gregorian calendar uses the same week numbering system as ISO 8601, by convention in many locales whose preferred calendar is gregory.

Whether other calendars have week numbering systems, I don't have the expertise to know. I think the question of whether a calendar has a week-numbering system, and how it works if so, is something that could be moved into the scope of this proposal, to prevent divergence between implementations.

ICU has generalized week-numbering code: https://github.com/unicode-org/icu/blob/ab72ab1d4a3c3f9beeb7d92b0c7817ca93dfdb04/icu4c/source/i18n/calendar.cpp#L1606
However, I don't know which calendars this is used for in practice.
CLDR-JSON has week formats in the Gregorian calendar: https://github.com/unicode-org/cldr-json/blob/858baad63c1d51e1d576ef99dccc229d92cedda4/cldr-json/cldr-dates-full/main/en/ca-gregorian.json#L396
But not in the Japanese calendar, which does have the same years and weeks as Gregorian (just not the same year numbers): https://github.com/unicode-org/cldr-json/blob/858baad63c1d51e1d576ef99dccc229d92cedda4/cldr-json/cldr-cal-japanese-full/main/en/ca-japanese.json#L1053

Concretely, this suggestion would mean including CalendarDateWeekOfYear in the scope of this proposal. (Note, we are planning to present a normative PR in the next TC39 plenary to allow calendars without a week numbering system to return { [[Year]]: undefined, [[Week]]: undefined } from this operation.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions