chinese-lunar-date API - v1.0.5
    Preparing search index...

    Function parseISO

    Date formatting with pattern tokens. See PATTERNS for presets and the format function docs for the full token reference table.

    • Parse an ISO format string back to LunarDateValue

      The ISO format uses - as separator and encodes leap as 0/1.

      Parameters

      • str: string

        ISO format string (e.g., "78-34-7-0-28")

      Returns LunarDateValue | null

      LunarDateValue, or null if the string is malformed

      parseISO('78-34-5-0-6')   // { cycle: 78, year: 34, month: 5, leap: false, day: 6 }
      parseISO('78-34-2-1-15') // { cycle: 78, year: 34, month: 2, leap: true, day: 15 }
      parseISO('invalid') // null