Function jalaliToGregorianYear

  • Converts a Jalali (Persian) year to the corresponding Gregorian year.

    The conversion is based on whether the Persian New Year (Nowruz, March 21st) has already occurred relative to the reference date.

    Parameters

    • jalaliYear: number

      The Jalali year to convert.

    • referenceDate: Date = ...

      The reference date to determine if the Gregorian year has started (default: current date).

    Returns number

    The Gregorian year corresponding to the provided Jalali year.

    jalaliToGregorianYear(1404); // returns 2025
    jalaliToGregorianYear(1404, new Date('2025-02-15')); // returns 2026