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 @@
-

@items.event_name@

+

@items.event_name@

Index: openacs-4/packages/calendar/www/view-one-day-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.tcl,v diff -u -r1.36.2.1 -r1.36.2.2 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 23 May 2008 21:19:00 -0000 1.36.2.1 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 29 May 2008 14:08:31 -0000 1.36.2.2 @@ -91,7 +91,7 @@ # Loop through the items without time -set additional_limitations_clause " and to_char(start_date, 'HH24:MI') = '00:00' and to_char(end_date, 'HH24:MI') = '00:00'" +set additional_limitations_clause " and to_char(start_date, 'HH24:MI') = to_char(end_date, 'HH24:MI')" if { [exists_and_not_null cal_system_type] } { append additional_limitations_clause " and system_type = :cal_system_type " } @@ -142,11 +142,11 @@ incr bump_right_base $bump_right_delta } -set additional_limitations_clause " and (to_char(start_date, 'HH24:MI') <> '00:00' or to_char(end_date, 'HH24:MI') <> '00:00')" +set additional_limitations_clause " and to_char(start_date, 'HH24:MI') <> to_char(end_date, 'HH24:MI')" if { [exists_and_not_null cal_system_type] } { append additional_limitations_clause " and system_type = :cal_system_type " } -set order_by_clause " order by to_char(start_date,'HH24')" +set order_by_clause " order by to_char(start_date,'HH24:MI')" set day_items_per_hour {} set adjusted_start_display_hour $start_display_hour @@ -168,6 +168,9 @@ set start_time [lc_time_fmt $ansi_start_date "%X"] set end_time [lc_time_fmt $ansi_end_date "%X"] + set start_hour [format %.0f [lc_time_fmt $ansi_start_date "%H"]] + set end_hour [format %.0f [lc_time_fmt $ansi_end_date "%H"]] + if { $start_hour < $adjusted_start_display_hour && \ [string equal \ [string range $ansi_start_date 0 9] \ Index: openacs-4/packages/calendar/www/view-week-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.adp,v diff -u -r1.18.2.5 -r1.18.2.6 --- openacs-4/packages/calendar/www/view-week-display.adp 23 May 2008 21:19:00 -0000 1.18.2.5 +++ openacs-4/packages/calendar/www/view-week-display.adp 29 May 2008 14:08:31 -0000 1.18.2.6 @@ -23,7 +23,7 @@
-

@items.event_name@

+

@items.event_name@

Index: openacs-4/packages/calendar/www/view-week-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.tcl,v diff -u -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/calendar/www/view-week-display.tcl 23 May 2008 20:45:47 -0000 1.20.2.1 +++ openacs-4/packages/calendar/www/view-week-display.tcl 29 May 2008 14:08:31 -0000 1.20.2.2 @@ -133,8 +133,12 @@ set start_time [lc_time_fmt $ansi_start_date "%X"] set end_time [lc_time_fmt $ansi_end_date "%X"] + set start_hour [format %.0f [lc_time_fmt $ansi_start_date "%H"]] + set end_hour [format %.0f [lc_time_fmt $ansi_end_date "%H"]] + set ansi_this_date [dt_julian_to_ansi [expr $first_weekday_julian + $current_weekday]] - if {[string equal $start_time "12:00 AM"] && [string equal $end_time "12:00 AM"]} { + + if { $start_time eq $end_time } { set no_time_p t } else { set no_time_p f @@ -162,7 +166,7 @@ set previous_intervals [list] } - if {[string equal $no_time_p t]} { + if { $no_time_p } { #All day event set top_hour 0 set top_minutes 0 @@ -189,29 +193,6 @@ set adjusted_end_display_hour $end_hour } - -# if { $start_hour < 9 } { -# set top_hour 9 -# set top_minutes 0 -# } elseif { $start_hour > 21 } { -# set top_hour 22 -# set top_minutes 0 -# } else { -# set top_hour $start_hour -# set top_minutes $start_minutes -# } - -# if { $end_hour < 9 } { -# set bottom_hour 9 -# set bottom_minutes 0 -# } elseif { $end_hour > 21 } { -# set bottom_hour 22 -# set bottom_minutes 0 -# } else { -# set bottom_hour $end_hour -# set bottom_minutes $end_minutes -# } - } set top [expr ($top_hour * ($hour_height_inside+$hour_height_sep)) \ @@ -228,12 +209,13 @@ #Assumption: for any given day we will loop through all-day events #before looping through regular events. set bumps 0 - if {$start_hour == 0 && $start_minutes == 0 && $end_hour == 0 && $end_minutes == 0} { + if { $no_time_p } { #All-day event. incr event_left_base $event_bump_delta incr all_day_events } else { #Regular event. + set name "$name ($start_time - $end_time)" foreach {previous_start previous_end} $previous_intervals { if { ($start_seconds >= $previous_start && $start_seconds < $previous_end) || ($previous_start >= $start_seconds && $previous_start < $end_seconds) } { incr bumps Index: openacs-4/packages/calendar/www/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.adp,v diff -u -r1.33.2.2 -r1.33.2.3 --- openacs-4/packages/calendar/www/view.adp 27 May 2008 15:10:30 -0000 1.33.2.2 +++ openacs-4/packages/calendar/www/view.adp 29 May 2008 14:08:31 -0000 1.33.2.3 @@ -36,8 +36,11 @@ - + Index: openacs-4/packages/calendar/www/resources/calendar.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/resources/calendar.css,v diff -u -r1.12.2.7 -r1.12.2.8 --- openacs-4/packages/calendar/www/resources/calendar.css 27 May 2008 15:10:31 -0000 1.12.2.7 +++ openacs-4/packages/calendar/www/resources/calendar.css 29 May 2008 14:08:32 -0000 1.12.2.8 @@ -214,6 +214,7 @@ width:100%; top:0px; z-index:3; + font-size: 90%; } .week-entry-box a {