/** * Check date time for insert update delete * * @param $start Date with time string in this format: Y-m-d*H:i:sP i.e. 2015-06-22T21:30:00+02:00 * @param $end Date with time string in this format: Y-m-d*H:i:sP i.e. 2015-06-22T21:30:00+02:00 * @param $resource */ public static function check_if_valid_start_end_i_u_d_or_die($start, $end, $resource) { // Check if start date is valid $start_parsed = Resource_Booking_Ajax_Common::check_if_valid_date_with_time_or_die($start); // Check if end date is valid $end_parsed = Resource_Booking_Ajax_Common::check_if_valid_date_with_time_or_die($end); // Check if start < end Resource_Booking_Ajax_Common::check_if_start_time_before_end_or_die($start_parsed, $end_parsed); // Check if start > now (and because of before, end > now) Resource_Booking_Ajax_Common::check_if_start_time_after_now_or_die($start_parsed); // Perform various tests on the booking interval Resource_Booking_Ajax_Common::check_if_valid_booking_for_resource_or_die($start_parsed, $end_parsed, $resource); }