Hi @hoverlord,
Sorry I didn’t have time earlier to check on this.
I just did a quick test and could not reproduce your problem. Could you please provide a sample of your code that displays the wrong date?
What I tested so far was creating a recurrence with a time value then updating the timezone in general settings. Whatever timezone I use the time value remains the same as the one selected in the field. But maybe I misunderstood the issue.
Hi @marcbelletre,
thanks for your reply! Our timezone in wordpress -> options -> general is set to “UTC+1”. When I make a new entry with RRule Field, for example with start time 19:00, save this entry and edit it again, the start time is changed to 18:00. I made two screenshots to make it clear:
https://freisicht.net/tmp/new_entry.png
https://freisicht.net/tmp/edit_entry.png
I can provide an admin acc if that helps.
the problem seems to be on the acf side. it seems like acf does not respect the time zone settings of wordpress. i was able to find a solution:
add_filter('date_i18n', function ($date, $format, $timestamp, $gmt) { return wp_date($format, $timestamp); }, 99, 4);
taken from this thread: https://github.com/AdvancedCustomFields/acf/issues/252
Hi @hoverlord,
Glad you sorted it out. I still don’t understand why I couldn’t reproduce this on my side…
Maybe the plugin should use wp_date
instead of date_i18n
if it makes more sense. I’m pretty busy right now but will have a look as soone as possible.
Thank you!
Hi Marc, I think date_i18n is right as the acf date field also seems to use it.
All the best wishes, Dirk