Merged
Conversation
…ocs-datetime # Conflicts: # lib/DateTimeHelper.php # lib/Twig.php # tests/test-timber-dates.php
2 tasks
acobster
requested changes
Jan 5, 2020
Codecov Report
@@ Coverage Diff @@
## 2.x-twig-date-compat #2136 +/- ##
=======================================================
Coverage ? 95.79%
Complexity ? 1542
=======================================================
Files ? 50
Lines ? 3944
Branches ? 0
=======================================================
Hits ? 3778
Misses ? 166
Partials ? 0Continue to review full report at Codecov.
|
acobster
reviewed
Jan 7, 2020
Member
Author
|
We’ll have to wait for #2135 to be merged before this can be merged. |
Member
Member
Author
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.
Ticket: #2104, #2127, #2135
Issue
It’s not very clear how to work with dates and times in Timber. And we all now, working with dates and times is hard 😅.
Solution
I added a new guide for working with dates and times in Timber. I’ve figured that writing a Date/Time guide for Timber is actually mostly a guide for working with Date/Time in WordPress itself.
The new guide builds on top of the updates to the Date/Time component in WordPress 5.3.
It highlights what you should and shouldn’t do. E.g., you should never use
date_default_timezone_set(), which is probably the base problem in #2104.Help wanted – In the guide I wrote down what I know about working with dates and times in WordPress. It could be that I’m still wrong in some places and would be glad if someone could help review that information.
Impact
Better documentation.
Usage Changes
None.
Considerations
Same as in #2135, the new guide makes use of new WordPress functionality in 5.3. Adding backwards compatibility could make the guide more complicated. Let’s discuss in #2135 how we should proceed about the backwards compatibility.
Testing
None.