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

isSameMonth

import { isSameMonth } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Are 2 September 2014 and 25 September 2014 in the same month?
const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
//=> true
@example
// Are 2 September 2014 and 25 September 2015 in the same month?
const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))
//=> false
function isSameMonth<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): boolean;
§
isSameMonth<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 month (and year)