( date: DateArg<DateType>, week: number, options?: SetISOWeekOptions<ResultDate>, )
| 34 | * //=> Sat Jan 01 2005 00:00:00 |
| 35 | */ |
| 36 | export function setISOWeek< |
| 37 | DateType extends Date, |
| 38 | ResultDate extends Date = DateType, |
| 39 | >( |
| 40 | date: DateArg<DateType>, |
| 41 | week: number, |
| 42 | options?: SetISOWeekOptions<ResultDate>, |
| 43 | ): ResultDate { |
| 44 | const _date = toDate(date, options?.in); |
| 45 | const diff = getISOWeek(_date, options) - week; |
| 46 | _date.setDate(_date.getDate() - diff * 7); |
| 47 | return _date; |
| 48 | } |
no test coverage detected