-
Notifications
You must be signed in to change notification settings - Fork 775
Fix BC break when using RFC3339 constants with Zulu timezone #1593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.4 #1593 +/- ##
============================================
+ Coverage 94.09% 94.12% +0.02%
- Complexity 455 459 +4
============================================
Files 99 99
Lines 1254 1259 +5
============================================
+ Hits 1180 1185 +5
Misses 74 74 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR attempts to fix a backward compatibility break introduced in version 2.3 where RFC 3339 timestamps with the Zulu timezone suffix ('Z') are no longer accepted as valid, addressing issue #1442.
Key changes:
- Modified the
CanValidateDateTimetrait to replace 'Z' suffix with '+00:00' for RFC3339_EXTENDED format validation - Added test case to verify RFC3339_EXTENDED format accepts timestamps with 'Z' suffix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| library/Helpers/CanValidateDateTime.php | Adds logic to replace 'Z' timezone suffix with '+00:00' when validating RFC3339_EXTENDED format |
| tests/unit/Helpers/CanValidateDateTimeTest.php | Adds test case for RFC3339_EXTENDED format with Zulu timezone suffix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e922981 to
2caaaae
Compare
2caaaae to
caa13e7
Compare
Addresses BC break in 2.x series reported in #1442 (maybe too late, but better than never fixed!)
I'm not sure we should do this in 3.x. Doing it in 2.x just to ensure BC with 2.2. While the PHP constant says "RFC3339", the RFC itself has several formats and PHP does not provide a full breadth of constants for all of the specified formats, so it's really not our fault. There should be a
\DateTime::RFC3339_Zor something. I'll provide a 3.x follow up in the next few days.