import toDate from '../toDate/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } dateLeft param { Date | Number } dateRight returns { Number } throws example export default function differenceInCalendarMonths ( dirtyDateLeft , dirtyDateRight ) { requiredArgs ( 2 , arguments ) ; const dateLeft = toDate ( dirtyDateLeft ) ; const dateRight = toDate ( dirtyDateRight ) ; const yearDiff = dateLeft . getFullYear ( ) - dateRight . getFullYear ( ) ; const monthDiff = dateLeft . getMonth ( ) - dateRight . getMonth ( ) ; return yearDiff * 12 + monthDiff ; }