MCPcopy Create free account
hub / github.com/angular/angular / getLocaleExtraDayPeriodRules

Function getLocaleExtraDayPeriodRules

packages/common/src/i18n/locale_data_api.ts:663–673  ·  view source on GitHub ↗
(locale: string)

Source from the content-addressed store, hash-verified

661 * Let `Intl.DateTimeFormat` determine the day period instead.
662 */
663export function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])[] {
664 const data = ɵfindLocaleData(locale);
665 checkFullData(data);
666 const rules = data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodsRules] || [];
667 return rules.map((rule: string | [string, string]) => {
668 if (typeof rule === 'string') {
669 return extractTime(rule);
670 }
671 return [extractTime(rule[0]), extractTime(rule[1])];
672 });
673}
674
675/**
676 * Retrieves locale-specific day periods, which indicate roughly how a day is broken up

Callers 1

getDateTranslationFunction · 0.90

Calls 3

checkFullDataFunction · 0.85
extractTimeFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected