Module: main

Library to get first day of week.

Uses data from langRegionMap.js and regionDayMap.js.

Source:

Methods


<static> getWeekStartByLocale(locale)

Parameters:
Name Type Description
locale string

Locale identifier.

Source:
See:
Returns:

Code of first day of week for the given locale identifier: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.

Type
number
Example
getWeekStartByLocale('no');   // 1
getWeekStartByLocale('Pa_Guru');   // 0
getWeekStartByLocale('fr-DZ');   // 6

<static> getWeekStartByRegion(regionCode)

Parameters:
Name Type Description
regionCode number | string

ISO 3166 Alpha-2, Alpha-3 or numeric code.

Source:
See:
Returns:

Code of first day of week for the given country/region code: 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.

Type
number
Example
getWeekStartByRegion('PNG');   // 1
getWeekStartByRegion('qa');   // 6
getWeekStartByRegion(462);   // 5