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

previousMonday

import { previousMonday } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// When is the previous Monday before Jun, 18, 2021?
const result = previousMonday(new Date(2021, 5, 18))
//=> Mon June 14 2021 00:00:00
function previousMonday<DateType extends Date>(date: DateType | number | string): DateType;
§
previousMonday<DateType extends Date>(date: DateType | number | string): DateType
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The date to start counting from

§Return Type

§
DateType
[src]

The previous Monday