( date: DateArg<DateType>, options?: StartOfISOWeekYearOptions<ResultDate> | undefined, )
| 36 | * //=> Mon Jan 03 2005 00:00:00 |
| 37 | */ |
| 38 | export 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 | } |
no test coverage detected