Derives the first day of week (0=Sun, 1=Mon, 6=Sat) from a BCP 47 code.
Uses Intl.Locale.getWeekInfo() where available (Chromium, Safari 15.4+),
with a CLDR-based fallback table for Firefox and older runtimes.
Parameters
code: string
A BCP 47 language tag (e.g. 'en-US', 'de-DE').
Returns 0|1|6
The first day of the week: 0 (Sunday), 1 (Monday), or 6 (Saturday).
Derives the first day of week (0=Sun, 1=Mon, 6=Sat) from a BCP 47 code. Uses
Intl.Locale.getWeekInfo()where available (Chromium, Safari 15.4+), with a CLDR-based fallback table for Firefox and older runtimes.