Date format
-
Hi !
I’m currently hitting the wall trying to resolve the date format issue i’m encountering using Custom Field Suite. I’m sure the solution is very simple, but my PHP skills being what they are… hm.
I’ve set up a few fields inside a custom widget this way :
$// Echo the metadata $fields9 = CFS()->get( 'dates_de_publication' ); // get the count on the repeater field $count9 = count( CFS()->get( 'dates_de_publication' ) ); // begin $count conditions if ($fields9) { if ( $count9 > 1 ) { // greater than 1 echo '<p class="headingeuh">' . __( 'Dates de publication') . '<div class="pp-heading-separator line_only pp-left"> <span class="pp-separator-line"> </span> </div> </p>'; } else { // less than 1 echo '<p class="headingeuh">' . __( 'Date de publication') . '<div class="pp-heading-separator line_only pp-left"> <span class="pp-separator-line"> </span> </div> </p>'; } foreach ( $fields9 as $field9 ) { echo '<li class="fildeuh">' . $field9['date_de_publication'] . '</li>'; } }
The point is to be able to display several dates (in a loop) and to pluralize the label when there’s more than one entry, or completely hide the label if there’s no entry at all. Everything works fine, except for the date format, which I can’t manage to display in a French format (d/m/Y).
Any help is appreciated !
- The topic ‘Date format’ is closed to new replies.