( date: DateArg<DateType>, amount: number, options?: AddDaysOptions<ResultDate> | undefined, )
| 3 | import type { AddDaysOptions } from "./index.ts"; |
| 4 | |
| 5 | export function tpyAddDays< |
| 6 | DateType extends Date, |
| 7 | ResultDate extends Date = DateType, |
| 8 | >( |
| 9 | date: DateArg<DateType>, |
| 10 | amount: number, |
| 11 | options?: AddDaysOptions<ResultDate> | undefined, |
| 12 | ): ResultDate { |
| 13 | let [temporal, invalidDate] = toTpInstant(date, options); |
| 14 | if (!temporal || isNaN(amount)) return invalidDate; |
| 15 | |
| 16 | const result = temporal.add({ days: amount }); |
| 17 | |
| 18 | return fromTp(result, date, options); |
| 19 | } |
nothing calls this directly
no test coverage detected