demo · v143
Calendar grid
The reason getWeekInfo() exists. Pick a locale — the calendar restyles using the locale's first day of the week and weekend days. Real applications: scheduling apps, payroll, store hours.
firstDay
—
weekend
—
minimalDays
—
calendar
—
—
Header sequence and weekend shading are driven by locale.getWeekInfo(); month labels and day numbers use Intl.DateTimeFormat with the calendar returned by locale.getCalendars().
the call
// v143: the function form
const loc = new Intl.Locale("ar-SA-u-ca-islamic-umalqura");
const wi = loc.getWeekInfo();
const calendar = loc.getCalendars()[0];
// Render days starting at wi.firstDay; highlight wi.weekend.
const dayNames = new Intl.DateTimeFormat(loc.toString(), { calendar, weekday: "short" })
.formatToParts(new Date(2024, 0, 7 /* a Sunday */)).map((p) => p.value);
why this angle
The other concept tabulates which getter still works. This one shows what week info is actually for: a real calendar widget that rotates its columns and shades its weekend based on the locale — the same pattern Google Calendar, payroll systems, and reservation tools follow.