Document day/month/year ordering for numeric dates (#10)#32
Merged
Conversation
Numeric-only slash dates are parsed in day/month/year order, not US month/day/year order, so "3/13/2014" returns undef (month 13 is invalid). This has long surprised US users (rt.cpan.org #94151). Per the discussion in #10, changing the parsing would silently re-interpret existing dates for every downstream caller, so the behaviour is intentionally preserved. Clarify it in the POD instead and add a test locking in the contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #32 +/- ##
=======================================
Coverage 89.70% 89.70%
=======================================
Files 1 1
Lines 68 68
Branches 29 29
=======================================
Hits 61 61
Misses 1 1
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10 (rt.cpan.org #94151).
What
HTTP::Dateparses numeric-only slash dates in day/month/year order (ISO / common European convention), not US month/day/year:3/12/2014→ 3 December 20143/13/2014→undef(13 is not a valid month) ← the reported "bug"13/3/2014→ 13 March 2014This has surprised US users for years. As discussed in #10, the maintainers (ether, jjatria) concluded that changing the parsing — silently swapping fields or warning — would re-interpret existing dates for every downstream caller and is too risky given this module's position in the CPAN river. The agreed resolution was to document the behaviour.
Changes
parse_dateexplaining the day/month/year ordering and how to handle US-style dates.t/numeric-date-order.tcharacterization test locking in the contract (3/12→Dec 3,3/13→undef,13/3→Mar 13).No behavioural change.
🤖 Generated with Claude Code