Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v diff -u -N -r1.35.2.6 -r1.35.2.7 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 19 Feb 2021 09:47:12 -0000 1.35.2.6 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 25 Jan 2022 14:00:42 -0000 1.35.2.7 @@ -21,7 +21,20 @@ } { A sanity check that the start time is before the end time. } { - return [db_string dates_valid_p_select {}] + try { + return [db_string dates_valid_p_select { + select CASE + WHEN cast(:start_date as timestamp with time zone) + <= + cast(:end_date as timestamp with time zone) THEN 1 + ELSE 0 + END from dual + }] + } on error {errmsg} { + # Invalid dates in input, definitely not ok. + ad_log warning $errmsg + return 0 + } } ad_proc -public calendar::item::new {