MCPcopy Index your code
hub / github.com/angular/angular / getLocaleExtraDayPeriodRules

Function getLocaleExtraDayPeriodRules

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

Source from the content-addressed store, hash-verified

638 * Let `Intl.DateTimeFormat` determine the day period instead.
639 */
640export function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])[] {
641 const data = ɵfindLocaleData(locale);
642 checkFullData(data);
643 const rules = data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodsRules] || [];
644 return rules.map((rule: string | [string, string]) => {
645 if (typeof rule === 'string') {
646 return extractTime(rule);
647 }
648 return [extractTime(rule[0]), extractTime(rule[1])];
649 });
650}
651
652/**
653 * 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…