MCPcopy
hub / github.com/date-fns/date-fns / startOfISOWeekYear

Function startOfISOWeekYear

pkgs/core/src/startOfISOWeekYear/index.ts:38–50  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  options?: StartOfISOWeekYearOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

36 * //=> Mon Jan 03 2005 00:00:00
37 */
38export function startOfISOWeekYear<
39 DateType extends Date,
40 ResultDate extends Date = DateType,
41>(
42 date: DateArg<DateType>,
43 options?: StartOfISOWeekYearOptions<ResultDate> | undefined,
44): ResultDate {
45 const year = getISOWeekYear(date, options);
46 const fourthOfJanuary = constructFrom(options?.in || date, 0);
47 fourthOfJanuary.setFullYear(year, 0, 4);
48 fourthOfJanuary.setHours(0, 0, 0, 0);
49 return startOfISOWeek(fourthOfJanuary);
50}

Callers 5

test.tsFile · 0.90
getISOWeekFunction · 0.90
setISOWeekYearFunction · 0.90
isSameISOWeekYearFunction · 0.90
getISOWeeksInYearFunction · 0.90

Calls 3

getISOWeekYearFunction · 0.90
constructFromFunction · 0.90
startOfISOWeekFunction · 0.90

Tested by

no test coverage detected