Skip to content

fix: reject impossible dates with offsets or fractional seconds - #305

Merged
vycdev merged 4 commits into
vycdev:developfrom
vycdev2:fix/reject-impossible-zoned-estimates
Nov 6, 2026
Merged

vycdev merged 4 commits into
vycdev:developfrom
vycdev2:fix/reject-impossible-zoned-estimates

Conversation

@vycdev2

@vycdev2 vycdev2 commented Nov 5, 2026 •

Copy link
Copy Markdown

Summary

  • Reject impossible zoned calendar dates in time estimates instead of letting Sugar roll them into another month.
  • Also cover milliseconds, compact (+0200) and hour-only (+02) offsets, and lowercase z in estimates. These still rolled February 30 into March.
  • Validate @due timestamps with fractional seconds like other timestamps; @due(2021-02-29T09:00:00.000Z) was read as 1 March.
  • Preserve valid UTC and offset dates; add regression coverage and a changelog note.

Verification

  • npm test -- --grep "rejects impossible zoned calendar estimates" — failed before the fix (February 30 was accepted), passed after.
  • npm run typecheck — passed.
  • npm test — passed (983 tests).
  • npm run compile — passed.
  • npm run format:check — passed.
  • git diff --check upstream/develop...HEAD — passed.

Risk

  • Low: calendar validation now includes zoned timestamps; duration parsing is unchanged.

Review follow-up

  • Added the extra suffixes and the @due fractional-seconds check. The new tests fail without them.
  • Compared develop and this branch on valid estimates and due dates, including natural-language ones: every result is unchanged. Only impossible dates and out-of-range offsets now return no date.
  • Rechecked: pnpm run typecheck, pnpm test (984 passing), pnpm run compile, and pnpm run format:check all pass.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

🤖 Generated with Claude Code

vycdev2 and others added 3 commits November 5, 2026 01:05
5.4.0 is already released, so the fix belongs in a new unreleased
patch section instead of the shipped release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Estimates still rolled impossible dates such as February 30 into March
when written with milliseconds, a compact or hour-only offset, or a
lowercase z. Accept the same suffixes as @Due parsing in the calendar
check.

@Due timestamps with fractional seconds skipped validation entirely and
were rolled over the same way. Validate them without the fraction, then
add it back, so they follow the same date and offset rules as other
timestamps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vycdev vycdev changed the title fix: reject impossible zoned calendar estimates fix: reject impossible dates with offsets or fractional seconds Nov 6, 2026
@vycdev
vycdev merged commit 68cdc9e into vycdev:develop Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants