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

Function weekNumberingYearGetter

packages/common/src/i18n/format_date.ts:558–569  ·  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

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

Callers 1

getDateFormatterFunction · 0.85

Calls 3

getLocaleNumberSymbolFunction · 0.90
getThursdayThisIsoWeekFunction · 0.85
padNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…