Support

Account

Home Forums ACF PRO Datepicker Problem

Helping

Datepicker Problem

  • All over sudden the datepicker field returns a wrong date, every datepicker field is one day too early. Even if I save the post, the saved data ist still one day early. It worked as expected before, just stumbled over that during a birthday cronjob. Am I overlooking something? Help is gladly appreciated.

  • F.Y.I: Checking the post vars shows the right value to save:

    acf[field_55b9e5d6b6561] = 19691123, that means 23. November 1969. So it is stored right into the database.

    I tried two things:

    $timestamp = strotime('19691123');
    $birthdate = date_i18n( get_option( 'date_format' ), $timestamp );

    which brings the wrong day: 22. November 1969

    $timezone = new DateTimeZone(get_option('timezone_string'));
    setlocale(LC_TIME, "de_DE.utf8");
    $geburtsdatum = '19691123;
    $geburtsdatum_dt = new DateTime($geburtsdatum , $timezone);
    $birthdate = $geburtsdatum_dt->format(get_option( 'date_format' ));

    which brings the correct date, but unfortunately in english language.

    I of course can replace the month names in the strings, but that does not solve the root of the problem: The field in the backend is still showing the wrong date. Any thoughts on this? I am a bit in despair …

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.