Support

Account

Forum Replies Created

  • this field is for an ‘events’ CPT that i’ll be consistently adding to in the future, so that’s not really an option. thanks for taking the time to have a look at it, though, much appreciated!

  • hi John. the problem, i’ve learned, is that ACF returns the current date if using strtotime and date_i18n. i’ve tested running a plain vanilla event_date_end and there’s nothing there, but as also reported here, this isn’t always the case!

    if i use your IF statement, is the rest of it basically correct?

  • just an update for anyone else:

    hi. just wanted to update you on the solution, which i found with help of Oxy Support. firstly, it IS a bug, and it’s been reported to the devs. it’s specific to Repeaters, because in testing i first rebuilt the whole site in Italian, but same issue; the ACF datepicker inside a Repeater refused to be anything but in English. the solution (in case anyone asks you) is to use a Code Block instead of Dynamic Data in a text Block. in the Code block (if the ACF datepicker field is ‘single_event_date’, and desired format is d F Y) is:

    $date_string =strtotime(get_field('single_event_date'));
                
        $formatted_date = date_i18n('d F Y',$date_string);
    
        echo $formatted_date;
  • but to update, when i change the datepicker Display and Return format to ‘Ymd’ from what i had, which was a Custom ‘d F Y’ then that does solve the 500 errors and the broekn front end pages. site is Italian. Me as admin user is also Italian (site default) so i have a basic translation issue, but no idea why.

  • hi jarvis,

    i’ve just spun up a fresh install, in Italian as Site Language before i did anything else, then imported pages, repeaters, CPT, and ACF fields and groups.

    I think i’m a bt closer to understanding what’s causing the issue, but not why or how to fix it. i use Oxygen, and it’s Repeater function to show my CPT (events) and it’s ACF fields (artist name, event venue, event date, address etc) on the page.

    i build the repeater array like this:
    post type: event
    meta_query > array: key: ‘single_event_date’ (ACF field), value: PHP Function return Value – ‘event_order’, compare: < (past dates)

    ‘event_order’ is a custom function written like this:
    function event_order() {
    $today = date(‘Ymd’);
    return $today;
    }

    the objective is this: there’s a bunch of events set in the past and future. in some arrays i want to show only Future events, in others i want to show only past events. the array key is an ACF field called ‘single_event_date.’ the PHP value is today’s date (expressed as the new function ‘event_order’), and the array compares today’s date to the single_event_date to separate those events that are in the past, and those that are in the future.

    the problem is this: when the Site Language is English, the code snippet and the meta_query arrays work perfectly. in the old site, switching Site Language to Italian broke everything. and in thhis new test intall the same thing happens. WHY, and why when the site language isn’t English, i have no idea, but it’s the snippet, and ACF. any ideas?

  • hi.

    beacause: pages without ACF content load fine, switching back the English as Site Language solves the issue, and leaving Site Language in Italian but disabling ACF works fine. also spun up another site, switched site language first, then installed ACF and added a Date Picker and that works too. so it’s building in ACF, then switching Site language that’s the problem. No error logs, but building on a Synology Diskstation and they hide them, which is unfortunate.

    i don’t actually care what the Site Language is, and it’s not a multilingual site and no language switching. the whole thing front end is Italian content, and all ACF field content too. it’s just the Date picker, the written months in format F or M (Jan or Janaury, Feb or Febraury etc, changed to Gen and Gennaio, Feb and Febbraio etc), that i need to string replace. even a translation plugin seems unnecessary, but i’m totally stuck. hope you can help!

  • if anyone can help with this, i’d really appreciate it.

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