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 -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 { Index: openacs-4/packages/calendar/tcl/cal-item-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.xql,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/calendar/tcl/cal-item-procs.xql 30 Apr 2018 13:54:38 -0000 1.11 +++ openacs-4/packages/calendar/tcl/cal-item-procs.xql 25 Jan 2022 14:00:42 -0000 1.11.2.1 @@ -10,15 +10,6 @@ - - - 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 - - - select