Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql 23 Jan 2002 07:36:31 -0000 1.2 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql 1 Apr 2002 23:45:43 -0000 1.3 @@ -8,11 +8,33 @@ select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D') as day_of_the_week, to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday')) -as sunday_of_the_week, +as sunday_date, to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday'),'J') as sunday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday')) -as saturday_of_the_week +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1) +as monday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1,'J') +as monday_julian, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2) +as tuesday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2,'J') +as tuesday_julian, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3) +as wednesday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3,'J') +as wednesday_julian, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4) +as thursday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4,'J') +as thursday_julian, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5) +as friday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5,'J') +as friday_julian, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6) +as saturday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6,'J') +as saturday_julian from dual Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 25 Mar 2002 15:12:37 -0000 1.1 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 1 Apr 2002 23:45:43 -0000 1.2 @@ -8,11 +8,33 @@ select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D') as day_of_the_week, next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') -as sunday_of_the_week, +as sunday_date, to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday'),'J') as sunday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday') -as saturday_of_the_week +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1 +as monday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1,'J') +as monday_julian, +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2 +as tuesday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2,'J') +as tuesday_julian, +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3 +as wednesday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3,'J') +as wednesday_julian, +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4 +as thursday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4,'J') +as thursday_julian, +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5 +as friday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5,'J') +as friday_julian, +next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6 +as saturday_date, +to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6,'J') +as saturday_julian from dual Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 29 Mar 2002 20:08:43 -0000 1.12 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 1 Apr 2002 23:45:43 -0000 1.13 @@ -3,7 +3,6 @@ { -calendar_details "" -date "" - -days_of_week "Sunday Monday Tuesday Wednesday Thursday Friday Saturday" -large_calendar_p 1 -master_bgcolor "black" -header_bgcolor "black" @@ -30,6 +29,11 @@ set) put data in an ns_set calendar_details. The key is the Julian date of the day, and the value is a string (possibly with HTML formatting) that represents the details. + + The variables in the templates are: + - day_template: julian,day,date,pretty_date + - next_week_template: + - prev_week_template: } { if {[empty_string_p $date]} { @@ -48,14 +52,21 @@ # Loop through the days of the week set julian $sunday_julian - set return_html "\n" - + set return_html "
+
+ \n" + + set days_of_week {Sunday Monday Tuesday Wednesday Thursday Friday Saturday} foreach day $days_of_week { + set lower_day [string tolower $day] + set julian [set ${lower_day}_julian] + set date [set ${lower_day}_date] + set pretty_date [util_AnsiDatetoPrettyDate $date] set day_html [subst $day_template] append return_html " -
$day_html
 " +
 " # Go through events while {1} { @@ -73,7 +84,7 @@ incr julian } - append return_html "
" + append return_html "
" return $return_html }