react-day-picker / src /ethiopic /lib /isSameYear.ts
AbdulElahGwaith's picture
Upload folder using huggingface_hub
cf86710 verified
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: Date, dateRight: Date): boolean {
const left = toEthiopicDate(dateLeft);
const right = toEthiopicDate(dateRight);
return left.year === right.year;
}