Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Go to Latest
function differenceInCalendarYears
import { differenceInCalendarYears } from "https://deno.land/x/date_fns@v2.0.0-alpha.35/index.js";

Examples

// How many calendar years are between 31 December 2013 and 11 February 2015? var result = differenceInCalendarYears( new Date(2015, 1, 11), new Date(2013, 11, 31) ) //=> 2

Parameters

dirtyDateLeft
  • the later date
dirtyDateRight
  • the earlier date