Get Localized Month and Weekday Names in JavaScript
To list localized month or weekday names, format a reference date with Intl.DateTimeFormat(locale, { month }) (or weekday) across the range — no hard-coded English arrays. Part of Locale-Sensitive Date Comparison and Sorting.
Why this scenario is tricky
Hard-coded ['January', ...] arrays are English-only and drift from the locale's real names (some locales capitalize differently or use distinct standalone forms). Generating them from Intl gives correct names for any locale and any width.
Minimal working solution
const fmt = new Intl.DateTimeFormat('fr-FR', { month: 'long', timeZone: 'UTC' });
const months = Array.from({ length: 12 }, (_, m) =>
fmt.format(new Date(Date.UTC(2024, m, 1)))); // ['janvier', 'février', ...]
Full production version
// Weekday names, starting Monday, in the 'short' width.
const fmt = new Intl.DateTimeFormat('de-DE', { weekday: 'short', timeZone: 'UTC' });
// 2024-01-01 is a Monday.
const days = Array.from({ length: 7 }, (_, i) => fmt.format(new Date(Date.UTC(2024, 0, 1 + i))));
Verification snippet
Common pitfalls
Frequently Asked Questions
How do I get month names in the user's language?
Format a reference date for each month with Intl.DateTimeFormat(locale, { month: 'long', timeZone: 'UTC' }). Looping January through December yields the localized names, and switching 'long' to 'short' or 'narrow' changes the width.
How do I get weekday names starting on Monday?
Format seven consecutive days beginning from a date you know is a Monday (2024-01-01) with { weekday: 'short' }. Because you control the starting day, you can order the array Monday-first or Sunday-first as your UI needs.