Skip to content

2.x Add a Date/Time guide#2136

Merged
gchtr merged 8 commits into2.x-twig-date-compatfrom
2.x-docs-datetime
Jan 7, 2020
Merged

2.x Add a Date/Time guide#2136
gchtr merged 8 commits into2.x-twig-date-compatfrom
2.x-docs-datetime

Conversation

@gchtr
Copy link
Copy Markdown
Member

@gchtr gchtr commented Jan 2, 2020

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.

@gchtr gchtr changed the base branch from 2.x to 2.x-twig-date-compat January 2, 2020 12:39
@gchtr gchtr added the 2.0 label Jan 2, 2020
@gchtr gchtr self-assigned this Jan 2, 2020
@gchtr gchtr marked this pull request as ready for review January 2, 2020 12:48
…ocs-datetime

# Conflicts:
#	lib/DateTimeHelper.php
#	lib/Twig.php
#	tests/test-timber-dates.php
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 6, 2020

Codecov Report

❗ No coverage uploaded for pull request base (2.x-twig-date-compat@627b15f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##             2.x-twig-date-compat    #2136   +/-   ##
=======================================================
  Coverage                        ?   95.79%           
  Complexity                      ?     1542           
=======================================================
  Files                           ?       50           
  Lines                           ?     3944           
  Branches                        ?        0           
=======================================================
  Hits                            ?     3778           
  Misses                          ?      166           
  Partials                        ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 627b15f...51d205e. Read the comment docs.

@gchtr gchtr changed the base branch from 2.x-twig-date-compat to 2.x January 7, 2020 20:44
@acobster acobster self-requested a review January 7, 2020 21:13
acobster
acobster previously approved these changes Jan 7, 2020
Copy link
Copy Markdown
Collaborator

@acobster acobster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go. Thanks!

@gchtr
Copy link
Copy Markdown
Member Author

gchtr commented Jan 7, 2020

We’ll have to wait for #2135 to be merged before this can be merged.

@jarednova
Copy link
Copy Markdown
Member

@gchtr could we switch the base branch on this to be 2.x-twig-date-compat to join into #2135, or is it easier to make it direct to 2.x?

@gchtr gchtr changed the base branch from 2.x to 2.x-twig-date-compat January 7, 2020 21:42
@gchtr
Copy link
Copy Markdown
Member Author

gchtr commented Jan 7, 2020

@gchtr could we switch the base branch on this to be 2.x-twig-date-compat to join into #2135, or is it easier to make it direct to 2.x?

I had that before, but somehow I couldn’t update the branch, it always said «Not found» 🤷‍♂️. No idea why… but anyways, let’s try to do this manually then.

@gchtr gchtr merged commit 1f61181 into 2.x-twig-date-compat Jan 7, 2020
@gchtr gchtr deleted the 2.x-docs-datetime branch January 7, 2020 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants