weekstart Module: api

# Module: api

Functions to get first day of week.

Source:
  - api.js, line 1

### Methods

#### <static> getWeekStartByLocale(locale, langRegionMap, regionDayMap)

  Return first day of week for locale identifier.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `locale` | string | Locale identifier.
  `langRegionMap` | object | Mapping of language code to country/region code that should be used to get result. Language codes should be in lower case.
  `regionDayMap` | object | Mapping of country/region code to first day of week that should be used to get result. Country codes should be in upper case.

  Source:
    - api.js, line 61

  ##### 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('no', {no: 'abc'}, {ABC: 3});   // 3
      getWeekStartByLocale('KK_arab', {kk_arab: 'CN'}, {CN: 0});   // 0
      getWeekStartByLocale('fr-DZ', {fr: 'FR'}, {FR: 1, DZ: 6});   // 6

#### <static> getWeekStartByRegion(regionCode, regionDayMap)

  Return first day of week for country/region code.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `regionCode` | number | string | ISO 3166 Alpha-2, Alpha-3 or numeric code.
  `regionDayMap` | object | Mapping of country/region code to first day of week that should be used to get result. Country codes should be in upper case.

  Source:
    - api.js, line 27

  ##### 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('png', {BR: 0, PNG: 3, EG: 6});   // 3
      getWeekStartByRegion('qa', {QA: 6});   // 6
      getWeekStartByRegion(50, {BD: 5, 50: 5, SD: 6});   // 5

#### Search results