( date: DateArg<DateType>, options?: EndOfISOWeekYearOptions<ResultDate> | undefined, )
| 36 | * //=> Sun Jan 01 2006 23:59:59.999 |
| 37 | */ |
| 38 | export function endOfISOWeekYear< |
| 39 | DateType extends Date, |
| 40 | ResultDate extends Date = DateType, |
| 41 | >( |
| 42 | date: DateArg<DateType>, |
| 43 | options?: EndOfISOWeekYearOptions<ResultDate> | undefined, |
| 44 | ): ResultDate { |
| 45 | const year = getISOWeekYear(date, options); |
| 46 | const fourthOfJanuaryOfNextYear = constructFrom(options?.in || date, 0); |
| 47 | fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); |
| 48 | fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); |
| 49 | const _date = startOfISOWeek(fourthOfJanuaryOfNextYear, options); |
| 50 | _date.setMilliseconds(_date.getMilliseconds() - 1); |
| 51 | return _date; |
| 52 | } |
no test coverage detected