import { normalizeDates } from "./_lib-normalizeDates.js";
import { compareAsc } from "./compareAsc.js";
import { differenceInCalendarYears } from "./differenceInCalendarYears.js";
function differenceInYears(laterDate, earlierDate, options) {
  const [laterDate_, earlierDate_] = normalizeDates(
    options?.in,
    laterDate,
    earlierDate
  );
  const sign = compareAsc(laterDate_, earlierDate_);
  const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));
  laterDate_.setFullYear(1584);
  earlierDate_.setFullYear(1584);
  const partial = compareAsc(laterDate_, earlierDate_) === -sign;
  const result = sign * (diff - +partial);
  return result === 0 ? 0 : result;
}
export {
  differenceInYears as default,
  differenceInYears
};
//# sourceMappingURL=differenceInYears.js.map
