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

Function getFirstThursdayOfYear

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

Source from the content-addressed store, hash-verified

506const JANUARY = 0;
507const THURSDAY = 4;
508function getFirstThursdayOfYear(year: number) {
509 const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
510 return createDate(
511 year,
512 0,
513 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear,
514 );
515}
516
517/**
518 * 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…