Getting fatal error if date is not valid

[ad_1]

Hello,

For now I have changed the line to this to make this work

try {
$endDate[0] = new DateTime( $endDate[0] );
} catch (Exception $e) {
continue;
}

Thanks for this report, although the issue you’re describing seems to indicate the time zone of your WP site is not accessible for some reason. It also shouldn’t be possible to add an invalid date unless you’re doing something custom.

Are you using a front-end form or some other custom means of setting the DateTime field, or modifying your WordPress time zone settings in some other way?

If so, be sure to double check the meta fields and their expected values: https://docs.piecalendar.com/article/8-meta-fields

_piecal_start_date expects a DateTime value like this: 2024-07-25T10:00:00

I have this issue noted for consideration in a future release.

Thanks!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer