I've created a CPT to store a show calendar.
An ACF field calendar
has been created to store places and dates of the shows. It is a repeater composed by 2 subfields: date
(type=date) and city
(type=select).
When I'm trying to copy the "calendar" field from one post to another, using
update_field( 'calendar', get_field( 'calendar', $id_post_origin ), $id_post_destination );
the dates are corrupted.
I've tried to run a delete_field()
before but the result isn't better.
e.g. if my original post is:
0 =>
array (size=2)
'city' => string 'Vesoul' (length=6)
'date' => string '02/09/2019' (length=10)
the destination post will be after copying:
0 =>
array (size=2)
'city' => string 'Vesoul' (length=6)
'date' => string '09/02/2019' (length=10)
Is it possible to specify a date format? To duplicate a field without modifying it?
Thank you