Home Forums Add-ons Repeater Field Change Date format in Repeater Field Reply To: Change Date format in Repeater Field

  • Good morning, John

    Thank you very much for your answer, however it seems that my problem is more complicated than it seems…

    Because I have to change the first “date” of a line of my repeater only, it is not a single date field.

    I tried to modify my code as well to test:

    # Affichage du Mois / Année de la période (1er Element / Date de départ)
    if( have_rows('dates') ):
    # Recuperation du champs "Dates"
    $firstDates   = get_field('dates');
    # On stop sur le premier item de la période
    $first_depart = $firstDates[0]['date_depart'];
    // format date
    $date1 = date('l d F Y', strtotime($first_depart));
    // OR
    $date2 = date('F Y', strtotime($first_depart));

    Here are some screenshots of my configuration of my dates fields:
    Repeater Field (Dates)
    Field 'Date_depart'

    I get the date of January 1, 1970
    I think there is a problem beyond me.

    And the result of the displayed code:
    Display on Website

    Thank you again for your help !

    Edit – Capture (IMG) are not showing…

    My Repeateur Field

    Date Sub_Field

    Display on Website