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.

Generate names, don't hard-code themEnglish arrays are wrong elsewhereGenerate names, don't hard-code them['Jan','Feb',...] literalEnglish onlyIntl month formatterany locale, any widthFormat a reference date per month/weekday to get localized names.

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', ...]

Month namesFormat each month of a reference yearMonth namesm = 0..11Intl monthlonglocalizednames

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))));

Weekday namesWalk seven days from a known MondayWeekday namesi = 0..6Intl weekdayfrom Mondaynames

Verification snippet

Month & Weekday Names assertionsKey cases assert correctlyAssertions that prove the edge casefr-FR month 0'janvier'de-DE weekday short'Mo','Di',...narrow widthsingle lettersno hard-coded arraytrue

Common pitfalls

Month & Weekday Names pitfallsCommon mistakes and their fixesWrongRight['January',...] literalEnglish onlyIntl month/weekday formatlocalized namesassume week starts Sundaywrong for many localespick the width optionnarrow/short/long

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.