If I get_field('my-date-field)
, the not filled date fields return NULL. But, if I fill the field with a date and, then, remove the date leave it empty again, it return an empty string.
Why? Is it posiible to return the same in both cases?
Thank you.
Solved. I was creating datetime from empty field:
new \DateTime(get_field('date', $item->ID, false))