• Converts a given lunar date to a solar (Gregorian) date. The function calculates the corresponding solar year, month, and day from the lunar date. If the lunar date is invalid or out of range, it returns -1.

    Parameters

    • lunar: LunarDate

      The lunar date object to convert. It should be a valid LunarDate object.

    Returns Date | -1

    A Date object representing the corresponding solar date, or -1 if the lunar date is invalid.

    // => 2025-01-30T00:00:00.000Z
    toSolar({ year: 2025, month: 1, day: 30, isLeapMonth: false })
    // => -1
    toSolar({ year: 1900, month: 1, day: 30, isLeapMonth: false })