Index: openacs-4/packages/calendar/www/mini-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/mini-calendar.tcl,v diff -u -r1.23.2.4 -r1.23.2.5 --- openacs-4/packages/calendar/www/mini-calendar.tcl 27 Jan 2023 14:55:22 -0000 1.23.2.4 +++ openacs-4/packages/calendar/www/mini-calendar.tcl 23 Mar 2023 17:12:41 -0000 1.23.2.5 @@ -73,22 +73,26 @@ } } -# Get the current month, day, and the first day of the month -dt_get_info $date - +# +# Parse the date and extract the information needed to render the +# calendar. +# set now [clock scan $date] -set date_list [dt_ansi_to_list $date] -set year [util::trim_leading_zeros [lindex $date_list 0]] -set month [util::trim_leading_zeros [lindex $date_list 1]] -set day [util::trim_leading_zeros [lindex $date_list 2]] - +lassign [dt_ansi_to_list $date] year month day set months_list [dt_month_names] set curr_month_idx [expr {[util::trim_leading_zeros [clock format $now -format "%m"]]-1}] set curr_day [clock format $now -format "%d"] set curr_month [clock format $now -format "%B"] set curr_year [clock format $now -format "%Y"] set curr_date_pretty [lc_time_fmt $date "%q"] +set dt_info [dt_get_info -dict $date] +set first_julian_date_of_month [dict get $dt_info first_julian_date_of_month] +set days_in_last_month [dict get $dt_info days_in_last_month] +set last_julian_date [dict get $dt_info last_julian_date] +set last_julian_date_in_month [dict get $dt_info last_julian_date_in_month] +set julian_date_today [dict get $dt_info julian_date_today] + set today [lc_time_fmt [dt_sysdate] "%q"] if {$view eq "month"} { Index: openacs-4/packages/calendar/www/view-month-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.adp,v diff -u -r1.24.2.2 -r1.24.2.3 --- openacs-4/packages/calendar/www/view-month-display.adp 21 Oct 2022 13:20:22 -0000 1.24.2.2 +++ openacs-4/packages/calendar/www/view-month-display.adp 23 Mar 2023 17:12:41 -0000 1.24.2.3 @@ -1,7 +1,7 @@ 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.29.2.1 -r1.29.2.2 --- openacs-4/packages/calendar/www/view-month-display.tcl 10 Nov 2022 13:15:02 -0000 1.29.2.1 +++ openacs-4/packages/calendar/www/view-month-display.tcl 23 Mar 2023 17:12:41 -0000 1.29.2.2 @@ -28,23 +28,23 @@ set exporting_p 0 } -dt_get_info $date - if {![info exists return_url]} { set return_url [ad_urlencode "../"] } - if {$calendar_id_list ne ""} { set calendars_clause [db_map dbqd.calendar.www.views.openacs_in_portal_calendar] } else { set calendars_clause [db_map dbqd.calendar.www.views.openacs_calendar] } -set date_list [dt_ansi_to_list $date] -set this_year [util::trim_leading_zeros [lindex $date_list 0]] -set this_month [util::trim_leading_zeros [lindex $date_list 1]] -set this_day [util::trim_leading_zeros [lindex $date_list 2]] +lassign [dt_ansi_to_list $date] this_year this_month this_day +set dt_info [dt_get_info -dict $date] +set prev_month [dict get $dt_info prev_month] +set next_month [dict get $dt_info next_month] +set first_julian_date_of_month [dict get $dt_info first_julian_date_of_month] +set last_julian_date_in_month [dict get $dt_info last_julian_date_in_month] +set first_day [dict get $dt_info first_day] set month_string [lindex [dt_month_names] $this_month-1]
-  @month_string@ @year@  +  @month_string@ @this_year@