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

Function weekNumberingYearGetter

packages/common/src/i18n/format_date.ts:559–570  ·  view source on GitHub ↗

* Returns a date formatter that provides the week-numbering year for the input date.

(size: number, trim = false)

Source from the content-addressed store, hash-verified

557 * Returns a date formatter that provides the week-numbering year for the input date.
558 */
559function weekNumberingYearGetter(size: number, trim = false): DateFormatter {
560 return function (date: Date, locale: string) {
561 const thisThurs = getThursdayThisIsoWeek(date);
562 const weekNumberingYear = thisThurs.getFullYear();
563 return padNumber(
564 weekNumberingYear,
565 size,
566 getLocaleNumberSymbol(locale, NumberSymbol.MinusSign),
567 trim,
568 );
569 };
570}
571
572type DateFormatter = (date: Date, locale: string, offset: number) => string;
573

Callers 1

getDateFormatterFunction · 0.85

Calls 3

getLocaleNumberSymbolFunction · 0.90
getThursdayThisIsoWeekFunction · 0.85
padNumberFunction · 0.85

Tested by

no test coverage detected