Home › Forums › Add-ons › Repeater Field › Date appears wrong on repeater field and data transfer › Reply To: Date appears wrong on repeater field and data transfer
About your first question, when your “desde” field is empty, it will return the today date same way if i do this:
$date = new DateTime();
You should make a condition to test if $date is not empty, like:
<?php $date = get_sub_field('desde', false, false);
if($date){
$date = new DateTime($date);
echo $date->format('d/m/Y');
} ?>
Second question…. not clear what you mean 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.