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.
-
leap
ISO format string (e.g., "78-34-7-0-28")
"78-34-7-0-28"
LunarDateValue, or null if the string is malformed
null
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 Copy
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
Date formatting with pattern tokens. See PATTERNS for presets and the format function docs for the full token reference table.