Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 12 Nov 2002 08:54:34 -0000 1.14
+++ openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 18 Nov 2002 18:01:12 -0000 1.15
@@ -43,10 +43,9 @@
HTML formatting) that represents the details.
} {
if {[string equal $days_of_week "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"]} {
- set days_of_week [list [_ acs-datetime.Sunday] [_ acs-datetime.Monday] [_ acs-datetime.Tuesday] [_ acs-datetime.Wednesday] [_ acs-datetime.Thursday] [_ acs-datetime.Friday] [_ acs-datetime.Saturday]]
+ set days_of_week [nsv_get locale "[lang::conn::locale],day"]
}
-
dt_get_info $date
set today_date [dt_sysdate]
@@ -58,7 +57,7 @@
set day_of_week $first_day_of_month
set julian_date $first_julian_date
- set month_heading [format "%s %s" $month $year]
+ set month_heading [string totitle [lc_time_fmt $date "%B %Y"]]
set next_month_url ""
set prev_month_url ""
@@ -75,7 +74,7 @@
# We offer an option to put the links to next and previous months
# in the title bar
- if { $prev_next_links_in_title == 0 } {
+ if { !$prev_next_links_in_title } {
set title "
$month_heading
@@ -102,7 +101,12 @@
| $title
-
-
+
$curr_month_localized
-
-
+
|
\n"
@@ -551,7 +561,8 @@
ad_proc dt_widget_calendar_navigation {
- {}
+ {-today_bgcolor "#e9e99c"}
+ -link_current_view:boolean
{base_url ""}
{view "week"}
{date ""}
@@ -604,20 +615,25 @@
set output "
- [dt_navbar_view $view $base_url $date]
+ [dt_navbar_view -link_current_view=$link_current_view_p $view $base_url $date]
[dt_navbar_year $view $base_url $date]\n"
if [string equal $view month] {
# month view
+
append output "
"
+
+ set months_list [list]
+ foreach month_name [nsv_get locale [lang::conn::locale],mon] {
+ lappend months_list [string totitle $month_name]
+ }
- set months_list [dt_month_names]
set now [clock scan $date]
set curr_month [expr [dt_trim_leading_zeros [clock format $now -format "%m"]]-1]
@@ -681,6 +697,8 @@
append output " "
} else {
+
+ # day or week view
append output "
[dt_navbar_month $view $base_url $date]
@@ -693,18 +711,23 @@
"
- set days_of_week "[_ acs-datetime.S_M_T_W_T_F_S]"
+ set first_day_of_week [nsv_get locale [lang::conn::locale],firstdayofweek]
-
- foreach day_of_week $days_of_week {
- append output "$day_of_week | \n"
+ set days_of_week {}
+ foreach day [nsv_get locale [lang::conn::locale],abday] {
+ lappend days_of_week [string toupper [string range $day 0 0]]
+ }
+ for { set i 0 } { $i < 7 } { incr i } {
+ append output "[lindex $days_of_week [expr ($i + $first_day_of_week) % 7 ]] | \n"
}
append output "
| "
set day_of_week 1
set julian_date $first_julian_date
set day_number $first_day
+ set julian_date_todays_date [dt_ansi_to_julian_single_arg [dt_sysdate]]
+
while {1} {
if {$julian_date < $first_julian_date_of_month} {
@@ -732,20 +755,26 @@
append output "\n"
}
+ if { $julian_date == $julian_date_todays_date } {
+ set bgcolor " bgcolor=\"${today_bgcolor}\""
+ } else {
+ set bgcolor {}
+ }
+
if {$before_month_p || $after_month_p} {
append output "
-
+ |
$day_number
| "
} elseif {$julian_date == $julian_date_today} {
append output "
-
+ |
$day_number
| "
} else {
append output "
-
+ |
$day_number
| "
@@ -788,10 +817,10 @@
}
append output "
- [_ acs-datetime.is] [dt_ansi_to_pretty]
+ [_ acs-datetime.is] [lc_time_fmt [dt_sysdate] "%q"]
| | |