MCPcopy
hub / github.com/date-fns/date-fns / tpyAddDays

Function tpyAddDays

pkgs/core/src/addDays/index.tp.ts:5–19  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  amount: number,
  options?: AddDaysOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

3import type { AddDaysOptions } from "./index.ts";
4
5export 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}

Callers

nothing calls this directly

Calls 2

toTpInstantFunction · 0.90
fromTpFunction · 0.90

Tested by

no test coverage detected