And actually, I realised I hadn’t formatted the date, so have this now —
$end_date_passed_check = DateTime::createFromFormat('Ymd', get_field('event_end_date'));
if ($end_date_passed_check->format('Ymd') < date('Ymd'))
{
$date_passed = 'date-passed';
}
But alas it’s adding the class randomly… not as it should be.