Hi y´all,
sorry, for being so vague about the problem , I just copied the error message and code without explanation as I was so busy trying to solve the problem.
Well, the code works on the front end so far. The exception error is thrown when I fill in the parameters (get_field(‘event_date’)); in the parentheses for the new instance:
$eventDate = new DateTime();