[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/getLocaleFirstDayOfWeek [Back]  [Original]

getLocaleFirstDayOfWeek Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common

getLocaleFirstDayOfWeek

function
deprecatedsince v18

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

Internationalization (i18n) Guide

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.
orthos-back.svg [orthos-back.svg]

On this page

    arrow_upward_alt Back to the top

    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

    Web Proxy Viewer  |  New URL  |  Original Page