Index: openacs-4/packages/calendar/www/view-week-display-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/calendar/www/view-week-display-postgresql.xql 12 Sep 2003 20:00:13 -0000 1.5 +++ openacs-4/packages/calendar/www/view-week-display-postgresql.xql 21 Sep 2003 22:14:45 -0000 1.6 @@ -22,6 +22,8 @@ coalesce(e.name, a.name) as name, coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, + (to_date(start_date,:ansi_date_format) - to_date(:first_weekday_of_the_week_tz, + :ansi_date_format)) as day_of_week, (select type from cal_item_types where item_type_id= cal_items.item_type_id) as item_type, cals.calendar_id, cals.calendar_name @@ -35,8 +37,8 @@ and s.interval_id = t.interval_id and e.activity_id = a.activity_id and start_date between - to_date(:first_weekday_of_the_week_system, :ansi_date_format) and - to_date(:last_weekday_of_the_week_system, :ansi_date_format) + to_date(:first_weekday_of_the_week_tz, :ansi_date_format) and + to_date(:last_weekday_of_the_week_tz, :ansi_date_format) and cals.package_id= :package_id and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id)) and cals.calendar_id = ci.on_which_calendar @@ -51,7 +53,7 @@ as day_of_the_week, cast(next_day(to_date(:start_date, 'YYYY-MM-DD') - cast('7 days' as interval), :first_us_weekday) as date) as first_weekday_date, -to_char(next_day(to_date(:start_date, 'YYYY-MM-DD') - cast('7 days' as interval), :first_us_weekday),'J') +to_char(next_day(to_date(:start_date, 'YYYY-MM-DD') - cast('7 days' as interval), :first_us_weekday),'J') as first_weekday_julian, cast(next_day(to_date(:start_date, 'YYYY-MM-DD') - cast('7 days' as interval), :first_us_weekday) + cast('6 days' as interval) as date) as last_weekday_date, 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.8 -r1.9 --- openacs-4/packages/calendar/www/view-week-display.tcl 12 Sep 2003 20:00:13 -0000 1.8 +++ openacs-4/packages/calendar/www/view-week-display.tcl 21 Sep 2003 22:15:00 -0000 1.9 @@ -76,15 +76,14 @@ multirow create week_items name item_id start_date calendar_name status_summary day_of_week start_date_weekday start_time end_time no_time_p full_item # Convert date from user timezone to system timezone -set first_weekday_of_the_week_system [lc_time_conn_to_system "$first_weekday_of_the_week 00:00:00"] -set last_weekday_of_the_week_system [lc_time_conn_to_system "$last_weekday_of_the_week 00:00:00"] +set first_weekday_of_the_week_tz [lc_time_conn_to_system "$first_weekday_of_the_week 00:00:00"] +set last_weekday_of_the_week_tz [lc_time_conn_to_system "$last_weekday_of_the_week 00:00:00"] db_foreach select_week_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] - set day_of_week [expr [lc_time_fmt $ansi_start_date "%f"] - $first_day_of_week] set start_date_weekday [lc_time_fmt $ansi_start_date "%A"] set start_date [lc_time_fmt $ansi_start_date "%x"]