Skip to content

Normative: Determine getWeekInfo().firstDay using First Day Overrides - #1097

Open
ptomato wants to merge 1 commit into
tc39:mainfrom
ptomato:1055-calendar-weekinfo
Open

Normative: Determine getWeekInfo().firstDay using First Day Overrides#1097
ptomato wants to merge 1 commit into
tc39:mainfrom
ptomato:1055-calendar-weekinfo

Conversation

@ptomato

@ptomato ptomato commented Sep 2, 2026

Copy link
Copy Markdown
Member

UTS-35 specifies an algorithm, called "First Day Overrides" (https://unicode.org/reports/tr35/tr35-dates.html#First_Day_Overrides) that determines what subtags in a locale identifier should influence the determination of the first day of the week, and with what priority.

Apply the algorithm to Intl.Locale.prototype.getWeekInfo().firstDay. Before this change, the RegionPreference algorithm was applied, which ignored the -u-ca calendar value.

The RegionPreference algorithm continues to be applied to the determination of the weekend days, which are not affected by the choice of calendar.

Closes: #1055

UTS-35 specifies an algorithm, called "First Day Overrides"
(https://unicode.org/reports/tr35/tr35-dates.html#First_Day_Overrides)
that determines what subtags in a locale identifier should influence the
determination of the first day of the week, and with what priority.

Apply the algorithm to Intl.Locale.prototype.getWeekInfo().firstDay.
Before this change, the RegionPreference algorithm was applied, which
ignored the `-u-ca` calendar value.

The RegionPreference algorithm continues to be applied to the
determination of the weekend days, which are not affected by the choice
of calendar.
@ptomato

ptomato commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Tests are in tc39/test262#5128.

Note the fallback priorities in that test; if you review this, it'd be good to review the test and see if you agree with the resulting priorities. You might be surprised by the influence of the options bag passed to the constructor. I think this result follows naturally from how the options are treated in the Intl.Locale constructor, but we could write this differently if we wanted a different result.

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

Labels

Projects

Status: Priority Issues

Development

Successfully merging this pull request may close these issues.

WeekInfoOfLocale: Handle "ca" Unicode extension

1 participant