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

differenceInQuarters

import { differenceInQuarters } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// How many full quarters are between 31 December 2013 and 2 July 2014?
const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
//=> 2
function differenceInQuarters<DateType extends Date>(
dateLeft: DateType | number | string,
dateRight: DateType | number | string,
): number;
§
differenceInQuarters<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string, options?: DifferenceInQuartersOptions): number
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
dateLeft: DateType | number | string
[src]
  • The later date
§
dateRight: DateType | number | string
[src]
  • The earlier date
§
  • An object with options.

§Return Type

§
number
[src]

The number of full quarters