react-day-picker
Version:
Customizable Date Picker for React
11 lines (10 loc) • 507 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.differenceInCalendarMonths = differenceInCalendarMonths;
const conversion_js_1 = require("../utils/conversion.js");
function differenceInCalendarMonths(dateLeft, dateRight) {
const hijriLeft = (0, conversion_js_1.toHijriDate)(dateLeft);
const hijriRight = (0, conversion_js_1.toHijriDate)(dateRight);
return ((hijriLeft.year - hijriRight.year) * 12 +
(hijriLeft.monthIndex - hijriRight.monthIndex));
}