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

isSameDay

import { isSameDay } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
//=> true
@example
// Are 4 September and 4 October in the same day?
const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
//=> false
@example
// Are 4 September, 2014 and 4 September, 2015 in the same day?
const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
//=> false
function isSameDay<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): boolean;
§
isSameDay<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): boolean
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
dateLeft: DateType | number | string
[src]
  • The first date to check
§
dateRight: DateType | number | string
[src]
  • The second date to check

§Return Type

§
boolean
[src]

The dates are in the same day (and year and month)