Loading...
const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
const label = days[(date.getDay() + 6) % 7];const format = new Intl.DateTimeFormat(locale, { weekday: 'short' });
const label = format.format(date);Intl takes weekday names from CLDR data, so the label is correct in every locale without hand-made tables.
Intl output in tests, which changes when CLDR data updates.Intl.DisplayNames, not from a handwritten list.Intl APIs instead of hardcoded patterns like 'MM/DD/YYYY'.CLDR is the data: formats, names and rules per locale. ICU is a library that implements formatting and collation using that data.
Engines ship different CLDR data releases and locale sets, so spacing, abbreviations or punctuation can differ slightly.
Usually not in the browser, because Intl already includes it. Bundle data only for features Intl lacks.