• Hi! When I put 17:00 as start time and save, it displays 16:00 after saving. Our timezone is UTC+1, we configured that correctly in wordpress general options.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marc Bellêtre

    (@marcbelletre)

    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.

    Thread Starter hoverlord

    (@hoverlord)

    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.

    Thread Starter hoverlord

    (@hoverlord)

    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

    Plugin Author Marc Bellêtre

    (@marcbelletre)

    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!

    Thread Starter hoverlord

    (@hoverlord)

    Hi Marc, I think date_i18n is right as the acf date field also seems to use it.
    All the best wishes, Dirk

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.