( date: DateArg<DateType>, day: number, options?: SetISODayOptions<ResultDate> | undefined, )
| 35 | * //=> Sun Sep 07 2014 00:00:00 |
| 36 | */ |
| 37 | export function setISODay< |
| 38 | DateType extends Date, |
| 39 | ResultDate extends Date = DateType, |
| 40 | >( |
| 41 | date: DateArg<DateType>, |
| 42 | day: number, |
| 43 | options?: SetISODayOptions<ResultDate> | undefined, |
| 44 | ): ResultDate { |
| 45 | const date_ = toDate(date, options?.in); |
| 46 | const currentDay = getISODay(date_, options); |
| 47 | const diff = day - currentDay; |
| 48 | return addDays(date_, diff, options); |
| 49 | } |