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.22.4.1 --- 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 29 May 2008 14:08:31 -0000 1.22.4.1 @@ -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 Index: openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl,v diff -u -r1.10.2.2 -r1.10.2.3 --- openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 27 May 2008 15:44:52 -0000 1.10.2.2 +++ openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 29 May 2008 14:08:31 -0000 1.10.2.3 @@ -18,7 +18,7 @@ calendar::item::get -cal_item_id $cal_item_id -array cal_item # no time? -set cal_item(no_time_p) [dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)] +set cal_item(no_time_p) [expr {!$cal_item(time_p)}] set date $cal_item(start_date) Index: openacs-4/packages/calendar/www/cal-item-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v diff -u -r1.21.2.1 -r1.21.2.2 --- openacs-4/packages/calendar/www/cal-item-view.tcl 22 May 2008 11:50:32 -0000 1.21.2.1 +++ openacs-4/packages/calendar/www/cal-item-view.tcl 29 May 2008 14:08:31 -0000 1.21.2.2 @@ -26,7 +26,7 @@ } # no time? -set cal_item(no_time_p) [dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)] +set cal_item(no_time_p) [expr {!$cal_item(time_p)}] # Attachment URLs if {[calendar::attachments_enabled_p]} { Index: openacs-4/packages/calendar/www/view-month-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.tcl,v diff -u -r1.22.2.3 -r1.22.2.4 --- openacs-4/packages/calendar/www/view-month-display.tcl 23 May 2008 21:19:00 -0000 1.22.2.3 +++ openacs-4/packages/calendar/www/view-month-display.tcl 29 May 2008 14:08:31 -0000 1.22.2.4 @@ -92,10 +92,11 @@ # Get the beginning and end of the month in the system timezone set first_date_of_month [dt_julian_to_ansi $first_julian_date_of_month] -set first_date_of_month_system [lc_time_conn_to_system "$first_date_of_month 00:00:00"] set last_date_in_month [dt_julian_to_ansi $last_julian_date_in_month] -set last_date_in_month_system [lc_time_conn_to_system "$last_date_in_month 23:59:59"] +set first_date_of_month_system "$first_date_of_month 00:00:00" +set last_date_in_month_system "$last_date_in_month 23:59:59" + set day_number $first_day set today_ansi_list [dt_ansi_to_list $today_date] @@ -172,24 +173,23 @@ set interval_limitation_clause [db_map dbqd.calendar.www.views.month_interval_limitation] db_foreach dbqd.calendar.www.views.select_items {} { - # Convert from system timezone to user timezone - set ansi_start_date [lc_time_system_to_conn $ansi_start_date] - set ansi_end_date [lc_time_system_to_conn $ansi_end_date] + if { $ansi_start_date eq $ansi_end_date } { + set time_p 0 + } else { + set time_p 1 + # Convert from system timezone to user timezone + set ansi_start_date [lc_time_system_to_conn $ansi_start_date] + set ansi_end_date [lc_time_system_to_conn $ansi_end_date] + } + # Localize set pretty_weekday [lc_time_fmt $ansi_start_date "%A"] set pretty_start_date [lc_time_fmt $ansi_start_date "%x"] set pretty_end_date [lc_time_fmt $ansi_end_date "%x"] set pretty_start_time [lc_time_fmt $ansi_start_date "%X"] set pretty_end_time [lc_time_fmt $ansi_end_date "%X"] - if { [string equal $ansi_start_date $ansi_end_date] && \ - [string equal [lc_time_fmt $ansi_start_date "%T"] "00:00:00"] } { - set time_p 0 - } else { - set time_p 1 - } - set julian_start_date [dt_ansi_to_julian_single_arg $ansi_start_date] if {!$exporting_p && $current_day < $julian_start_date} { Index: openacs-4/packages/calendar/www/view-one-day-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.adp,v diff -u -r1.23.2.4 -r1.23.2.5 --- openacs-4/packages/calendar/www/view-one-day-display.adp 23 May 2008 21:19:00 -0000 1.23.2.4 +++ openacs-4/packages/calendar/www/view-one-day-display.adp 29 May 2008 14:08:31 -0000 1.23.2.5 @@ -12,7 +12,7 @@