[Plugin: Advanced Custom Fields] Problem with displaying a date in a repeater field
-
Hi,
I’m using the Advanced Custom Fields plugin, and I’m having a small problem with properly formatting and displaying the date in a repeater field, in a site I’m making.
I had a search through the archives and I couldn’t find anyone else who had the same problem, though there were a few similar ones – apologies if this question has been asked and answered before.
I had started by creating a repeater field, which contained two text fields as subfields:
<?php $rows = get_field('performances'); if($rows) { echo '<dl>'; foreach($rows as $row) { echo '<dt>' . $row['performance_date'] . '</dt> <dd>' . $row['performance_details'] .'</dd>'; } echo '</dl>'; } ?>
However, I then changed the first subfield,
performance_date
, to be a date picker field instead of a text field. It now accurately displays the date entered, but it does so in the format YYYYMMDD. This remains the format, even when I alter the ‘Save format’ and ‘Display format’ settings for the date picker subfield. Is there something I can do to change the code above to control the formatting of the date?I’ve been getting to grips with this plugin (and PHP more generally) over the last few days, so I apologise if I’m missing something obvious.
Thanks.
https://www.ads-software.com/extend/plugins/advanced-custom-fields/
- The topic ‘[Plugin: Advanced Custom Fields] Problem with displaying a date in a repeater field’ is closed to new replies.