Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

nextDay

import { nextDay } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// When is the next Monday after Mar, 20, 2020?
const result = nextDay(new Date(2020, 2, 20), 1)
//=> Mon Mar 23 2020 00:00:00
@example
// When is the next Tuesday after Mar, 21, 2020?
const result = nextDay(new Date(2020, 2, 21), 2)
//=> Tue Mar 24 2020 00:00:00
function nextDay<DateType extends Date>(date: DateType | number | string, day: Day): DateType;
§
nextDay<DateType extends Date>(date: DateType | number | string, day: Day): DateType
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The date to check
§
  • day of the week

§Return Type

§
DateType
[src]

The date is the next day of week