Date formatting with pattern tokens. See PATTERNS for presets and the format function docs for the full token reference table.
Parse a compact format string back to LunarDateValue
The compact format uses / as separator and encodes leap as 0/1.
/
leap
Compact format string (e.g., "78/34/7/0/28")
"78/34/7/0/28"
LunarDateValue, or null if the string is malformed
null
parseCompact('78/34/5/0/6') // { cycle: 78, year: 34, month: 5, leap: false, day: 6 }parseCompact('78/34/2/1/15') // { cycle: 78, year: 34, month: 2, leap: true, day: 15 }parseCompact('invalid') // null Copy
parseCompact('78/34/5/0/6') // { cycle: 78, year: 34, month: 5, leap: false, day: 6 }parseCompact('78/34/2/1/15') // { cycle: 78, year: 34, month: 2, leap: true, day: 15 }parseCompact('invalid') // null
Date formatting with pattern tokens. See PATTERNS for presets and the format function docs for the full token reference table.