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

Function nextDay

pkgs/core/src/nextDay/index.ts:36–48  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  day: Day,
  options?: NextDayOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

34 * //=> Tue Mar 24 2020 00:00:00
35 */
36export function nextDay<
37 DateType extends Date,
38 ResultDate extends Date = DateType,
39>(
40 date: DateArg<DateType>,
41 day: Day,
42 options?: NextDayOptions<ResultDate> | undefined,
43): ResultDate {
44 let delta = day - getDay(date, options);
45 if (delta <= 0) delta += 7;
46
47 return addDays(date, delta, options);
48}

Callers 8

nextThursdayFunction · 0.90
nextTuesdayFunction · 0.90
nextMondayFunction · 0.90
test.tsFile · 0.90
nextWednesdayFunction · 0.90
nextFridayFunction · 0.90
nextSaturdayFunction · 0.90
nextSundayFunction · 0.90

Calls 2

getDayFunction · 0.90
addDaysFunction · 0.90

Tested by

no test coverage detected