Files
2026-05-30 19:59:39 -03:00

14 lines
473 B
JavaScript

import { toEthiopicDate } from "../utils/index.js";
/**
* Checks if two dates fall in the same Ethiopian year.
*
* @param dateLeft - The first gregorian date to compare
* @param dateRight - The second gregorian date to compare
* @returns True if the dates are in the same Ethiopian year
*/
export function isSameYear(dateLeft, dateRight) {
const left = toEthiopicDate(dateLeft);
const right = toEthiopicDate(dateRight);
return left.year === right.year;
}