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

isSameQuarter

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