Skip to content
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

use wp_date() to fix possible date offset in WP 5.3 sites (#166) #167

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Jul 3, 2020

This PR fixes #166.

Introduce a new wrapper function Statify::parse_date( $date ) that uses wp_date() when available (WP 5.3+) with fallback to the previous date_i18n() call.

date_i18n() is a wrapper for wp_date() since WP 5.3 and tries to re-calculate the timezone offset. This clashes in several scenarios when the date (implicitly 00:00:00) is shifted back, s.t. the dashboard widget shows an offset of -1 day in these cases.

@stklcode stklcode added the bug label Jul 3, 2020
@stklcode stklcode added this to the 1.7.3 milestone Jul 3, 2020
@patrickrobrecht patrickrobrecht merged commit c486e5c into master Jul 13, 2020
@patrickrobrecht patrickrobrecht deleted the fix/166-dateoffset branch July 13, 2020 19:26
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.

Dashboard widget shows wrong date
2 participants