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

isBefore

import { isBefore } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Is 10 July 1989 before 11 February 1987?
const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
//=> false
function isBefore<DateType extends Date>(date: DateType | number | string, dateToCompare: DateType | number | string): boolean;
§
isBefore<DateType extends Date>(date: DateType | number | string, dateToCompare: DateType | number | string): boolean
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The date that should be before the other one to return true
§
dateToCompare: DateType | number | string
[src]
  • The date to compare with

§Return Type

§
boolean
[src]

The first date is before the second date