• 개요
@angular/common

getLocaleFirstDayOfWeek

함수
사용 중단 권고v18.0부터

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

사용 중단을 권고합니다.

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.

상세 내용으로 이동