Home › Forums › General Issues › Date Picker for Coupon use › Reply To: Date Picker for Coupon use
Hi @madmaxy
You should check for the get_field around everything instead. Since otherwise you attempt to create a datetime etc. with no second parameter so $datum wont be empty.
if( get_field('gultigkeit') ){
$date = DateTime::createFromFormat(‘Ymd’, get_field(‘gultigkeit’));
$datum = $date->format(‘d-m-Y’);
$heute = date(‘d-m-Y’);
}
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.