• Overview
@angular/common

getLocaleFirstDayOfWeek

function
deprecatedsince v18

Retrieves the first day of the week for the given locale.

Deprecation warning

Angular recommends relying on the Intl API for i18n. Intl's getWeekInfo has partial support (Chromium M99 & Safari 17). You may want to rely on the following alternatives:

  • Libraries like Luxon rely on Intl but fallback on the ISO 8601 definition (monday) if getWeekInfo is not supported.
  • Other librairies like date-fns, day.js or weekstart library provide their own locale based data for the first day of the week.

API

function getLocaleFirstDayOfWeek(locale: string): WeekDay;
@deprecated

Angular recommends relying on the Intl API for i18n. Intl's getWeekInfo has partial support (Chromium M99 & Safari 17). You may want to rely on the following alternatives:

  • Libraries like Luxon rely on Intl but fallback on the ISO 8601 definition (monday) if getWeekInfo is not supported.
  • Other librairies like date-fns, day.js or weekstart library provide their own locale based data for the first day of the week.
@paramlocalestring

A locale code for the locale format rules to use.

@returnsWeekDay

A day index number, using the 0-based week-day index for en-US (Sunday = 0, Monday = 1, ...). For example, for fr-FR, returns 1 to indicate that the first day is Monday.

Jump to details