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.22 -r1.23 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 16 Aug 2006 17:52:14 -0000 1.22 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 30 Aug 2008 19:51:23 -0000 1.23 @@ -45,9 +45,15 @@ set activity_id [db_exec_plsql insert_activity {} ] # Convert from user timezone to system timezone - set start_date [lc_time_conn_to_system $start_date] - set end_date [lc_time_conn_to_system $end_date] - + if { $start_date ne $end_date } { + + # Convert to server timezone only if it's not an all-day event + # otherwise, keep the start and end time as 00:00 + + set start_date [lc_time_conn_to_system $start_date] + set end_date [lc_time_conn_to_system $end_date] + } + set timespan_id [db_exec_plsql insert_timespan {}] # create the cal_item @@ -109,7 +115,7 @@ set row(end_date_ansi) [lc_time_system_to_conn $row(end_date_ansi)] } - if { $row(start_date_ansi) == $row(end_date_ansi) && [string equal [lc_time_fmt $row(start_date_ansi) "%T"] "00:00:00"]} { + if { $row(start_date_ansi) eq $row(end_date_ansi) } { set row(time_p) 0 } else { set row(time_p) 1 @@ -187,9 +193,15 @@ } # Convert from user timezone to system timezone - set start_date [lc_time_conn_to_system $start_date] - set end_date [lc_time_conn_to_system $end_date] + if { $start_date ne $end_date } { + # Convert to server timezone only if it's not an all-day event + # otherwise, keep the start and end time as 00:00 + + set start_date [lc_time_conn_to_system $start_date] + set end_date [lc_time_conn_to_system $end_date] + } + db_dml update_event {} # update the time interval based on the timespan id