Skip to content

v4.5.0

Latest

Choose a tag to compare

@knowledgecode knowledgecode released this 06 May 02:27
b505b94

What's Changed

  • docs: migrate documentation site from VitePress to Astro Starlight by @knowledgecode in #123
  • feat: add defaultDate option to parse/isValid for partial date string support by @knowledgecode in #124

Major Changes

  • New defaultDate option: parse() and isValid() now accept a defaultDate object (ParsedComponents) to supply fallback values for date/time components missing from the format string — useful for parsing time-only, month-day, or other partial date strings
  • ParsedComponents interface: Extracted from PreparseResult into parser.ts as a standalone, reusable interface; PreparseResult now extends it
  • Validation improvement: isValid() validates defaultDate components (e.g. an out-of-range H in defaultDate returns false); leap-day validation now respects a defaultDate.Y context
  • Precedence rule: defaultDate.Z (timezone offset in minutes) takes precedence over the timeZone option when both are present

Full Changelog: v4.4.0...v4.5.0