File size: 349 Bytes
cf86710
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { toHebrewDate } from "../utils/dateConversion.js";
import { monthsSinceEpoch } from "../utils/serial.js";

export function differenceInCalendarMonths(
  dateLeft: Date,
  dateRight: Date,
): number {
  const left = toHebrewDate(dateLeft);
  const right = toHebrewDate(dateRight);
  return monthsSinceEpoch(left) - monthsSinceEpoch(right);
}