Skip to content

Display dates beyond jiff's range without panicking - #11187

Merged
connortsui20 merged 1 commit into
developfrom
ct/date-display-fallback
Nov 4, 2026
Merged

connortsui20 merged 1 commit into
developfrom
ct/date-display-fallback

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

Date accepts every i32 day count and every i64 millisecond count, but jiff only holds the years -9999 to 9999, so formatting a valid Date outside that range panicked. Display now prints the raw value and unit instead (e.g., 10000000days), like the Timestamp fallback from #10953.

Changes

Tests cover the first date after 9999-12-31, day and millisecond counts that a jiff Span can't hold, and an ordinary date whose output doesn't change.

A `Date` accepts every `i32` day count and every `i64` millisecond count,
but its `Display` panicked for a date that jiff cannot hold, such as one
after the year 9999. It now prints the raw value and unit instead, as the
`Display` of `Timestamp` has done since #10953.

Signed-off-by: Connor Tsui <[email protected]>
@connortsui20 connortsui20 added the changelog/fix A bug fix label Nov 3, 2026
@connortsui20
connortsui20 marked this pull request as ready for review November 3, 2026 22:55
@connortsui20
connortsui20 enabled auto-merge (squash) November 3, 2026 22:57
@connortsui20 connortsui20 mentioned this pull request Nov 3, 2026
12 of 49 tasks
@connortsui20
connortsui20 merged commit d5271f9 into develop Nov 4, 2026
150 checks passed
@connortsui20
connortsui20 deleted the ct/date-display-fallback branch November 4, 2026 12:13
connortsui20 added a commit that referenced this pull request Nov 4, 2026
TS (#10953) merged on 2026-11-03, and SN1 (#11183) and V10 (#11187)
merged on 2026-11-04. The dependency graph marks the three merged and
moves its state date to 2026-11-04. It gives SD, DP, FD and U9 their
open PRs (#11184, #11185, #11186 and #11188), and it drops #10408,
which closed without a merge. The text of parts 4 and 5 and the Fix
lines of EXT-V9, EXT-V10, EXT-N2 and EXT-S3 now record the same state.

Also record that AX, DS and SN2 are implemented on branches without a
PR, and add the approved one-pass design for the masked nulls of SN2.

Part 2 and decision X31 also record the fixes: #10953 made every i64
legal, #11183 made the spatial validators reject nullable nested
levels, #11187 gave the Date display its fallback, and #10408 closed.

Signed-off-by: Connor Tsui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants