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

Function getFirstThursdayOfYear

packages/common/src/i18n/format_date.ts:509–516  ·  view source on GitHub ↗
(year: number)

Source from the content-addressed store, hash-verified

507const JANUARY = 0;
508const THURSDAY = 4;
509function getFirstThursdayOfYear(year: number) {
510 const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
511 return createDate(
512 year,
513 0,
514 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear,
515 );
516}
517
518/**
519 * ISO Week starts on day 1 (Monday) and ends with day 0 (Sunday)

Callers 1

weekGetterFunction · 0.85

Calls 1

createDateFunction · 0.85

Tested by

no test coverage detected