Index: openacs-4/packages/calendar/www/view-list-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/calendar/www/view-list-display.tcl 10 Jan 2004 00:22:13 -0000 1.19 +++ openacs-4/packages/calendar/www/view-list-display.tcl 21 Jan 2004 11:41:11 -0000 1.20 @@ -77,8 +77,11 @@ set last_pretty_start_date "" # Loop through the events, and add them -set interval_limitation_clause " to_timestamp(:start_date,'YYYY-MM-DD HH24:MI:SS') and to_timestamp(:end_date, 'YYYY-MM-DD HH24:MI:SS')" - +if {[string match [db_type] "postgresql"]} { + set interval_limitation_clause " to_timestamp(:start_date,'YYYY-MM-DD HH24:MI:SS') and to_timestamp(:end_date, 'YYYY-MM-DD HH24:MI:SS')" +} else { + set interval_limitation_clause " to_date(:start_date,'YYYY-MM-DD HH24:MI:SS') and to_date(:end_date, 'YYYY-MM-DD HH24:MI:SS')" +} set order_by_clause " order by $sort_by" set additional_limitations_clause "" 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.13 -r1.14 --- openacs-4/packages/calendar/www/view-month-display.tcl 10 Jan 2004 00:19:03 -0000 1.13 +++ openacs-4/packages/calendar/www/view-month-display.tcl 21 Jan 2004 11:41:11 -0000 1.14 @@ -104,7 +104,11 @@ set current_day $first_julian_date_of_month # Set the necessary variables for the unified calendar query in views.xql. -set interval_limitation_clause " to_timestamp(:first_date_of_month_system,'YYYY-MM-DD HH24:MI:SS') and to_timestamp(:last_date_in_month_system, 'YYYY-MM-DD HH24:MI:SS')" +if {[string match [db_type] "postgresql"]} { + set interval_limitation_clause " to_timestamp(:first_date_of_month_system,'YYYY-MM-DD HH24:MI:SS') and to_timestamp(:last_date_in_month_system, 'YYYY-MM-DD HH24:MI:SS')" +} else { + set interval_limitation_clause " to_date(:first_date_of_month_system,'YYYY-MM-DD HH24:MI:SS') and to_date(:last_date_in_month_system, 'YYYY-MM-DD HH24:MI:SS')" +} set order_by_clause " order by ansi_start_date, ansi_end_date" set additional_limitations_clause "" set additional_select_clause "" 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.25 -r1.26 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 10 Jan 2004 00:19:03 -0000 1.25 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 21 Jan 2004 11:41:11 -0000 1.26 @@ -72,7 +72,12 @@ multirow create day_items_without_time name status_summary item_id calendar_name full_item # Set the necessary variables for the unified calendar query in views.xql. -set interval_limitation_clause " to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') and to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') + cast('23 hours 59 minutes 59 seconds' as interval)" +if {[string match [db_type] "postgresql"]} { + set interval_limitation_clause " to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') and to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') + cast('23 hours 59 minutes 59 seconds' as interval)" +} else { + set interval_limitation_clause " to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') and (to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') + (24 - 1/3600)/24) " +} + set additional_limitations_clause " and to_char(start_date, 'HH24:MI') = '00:00' and to_char(end_date, 'HH24:MI') = '00:00'" set additional_select_clause "" set order_by_clause " order by name" Index: openacs-4/packages/calendar/www/views-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/views-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar/www/views-oracle.xql 10 Jan 2004 00:19:03 -0000 1.1 +++ openacs-4/packages/calendar/www/views-oracle.xql 21 Jan 2004 11:41:11 -0000 1.2 @@ -7,14 +7,13 @@ select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, - trunc(start_date - to_date(:first_weekday_of_the_week_tz, - 'YYYY-MM-DD HH24:MI:SS')) as day_of_week, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, cals.calendar_name +$additional_select_clause from acs_activities a, acs_events e, timespans s, @@ -24,12 +23,8 @@ where e.timespan_id = s.timespan_id and s.interval_id = t.interval_id and e.activity_id = a.activity_id -and start_date between - to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') and - (to_date(:current_date_system,'YYYY-MM-DD HH24:MI:SS') + (:end_display_hour - 1/3600)/:end_display_hour) +and start_date between $interval_limitation_clause and ci.cal_item_id = e.event_id -and (to_char(start_date, 'HH24:MI') <> '00:00' or - to_char(end_date, 'HH24:MI') <> '00:00') and cals.calendar_id = ci.on_which_calendar and e.event_id = ci.cal_item_id $additional_limitations_clause