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

Function getLocaleExtraDayPeriods

packages/common/src/i18n/locale_data_api.ts:696–709  ·  view source on GitHub ↗
(
  locale: string,
  formStyle: FormStyle,
  width: TranslationWidth,
)

Source from the content-addressed store, hash-verified

694 * To extract a day period use `Intl.DateTimeFormat` with the `dayPeriod` option instead.
695 */
696export function getLocaleExtraDayPeriods(
697 locale: string,
698 formStyle: FormStyle,
699 width: TranslationWidth,
700): string[] {
701 const data = ɵfindLocaleData(locale);
702 checkFullData(data);
703 const dayPeriodsData = <string[][][]>[
704 data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodFormats],
705 data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone],
706 ];
707 const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
708 return getLastDefinedValue(dayPeriods, width) || [];
709}
710
711/**
712 * Retrieves the writing direction of a specified locale

Callers 1

getDateTranslationFunction · 0.90

Calls 2

checkFullDataFunction · 0.85
getLastDefinedValueFunction · 0.85

Tested by

no test coverage detected