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

getLocaleFirstDayOfWeek

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

@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
Jump to details