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.5 -r1.6 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 18 Nov 2002 18:01:12 -0000 1.5 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 21 Dec 2002 22:32:20 -0000 1.6 @@ -3,9 +3,91 @@ postgresql7.1 + + +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_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')-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, +:current_date::timestamp - '7 days'::timespan as last_week, +to_char(:current_date::timestamp - '7 days'::interval, 'Month DD, YYYY') as last_week_pretty, +:current_date::timestamp + '7 days'::timespan as next_week, +to_char(:current_date::timestamp + '7 days'::interval, 'Month DD, YYYY') as next_week_pretty +from dual + + + + + +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_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')-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, +:current_date::timestamp - '7 days'::timespan as last_week, +to_char(:current_date::timestamp - '7 days'::interval, 'Month DD, YYYY') as last_week_pretty, +:current_date::timestamp + '7 days'::timespan as next_week, +to_char(:current_date::timestamp + '7 days'::interval, 'Month DD, YYYY') as next_week_pretty +from dual + + + -select to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') +select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'Day, DD Month YYYY') +as day_of_the_week, +to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') as yesterday, to_char(to_date(:current_date, 'yyyy-mm-dd')+1, 'yyyy-mm-dd') as tomorrow