Index: openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 14 Sep 2002 17:30:43 -0000 1.5 +++ openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 13 Mar 2003 02:18:58 -0000 1.5.2.1 @@ -242,7 +242,12 @@ set month [expr $month + 1] } - return [clock format [clock scan $year-$month-01] -format %Y-%m-%d] + # jarkko: added this check to avoid calendars bombing when prev month goes + # beyond borders + if {[catch {set next_month [clock format [clock scan $year-$month-01] -format %Y-%m-%d]} err]} { + return "" + } + return $next_month } ad_proc dt_prev_month { @@ -258,7 +263,13 @@ set month [expr $month - 1] } - return [clock format [clock scan $year-$month-01] -format %Y-%m-%d] + # jarkko: added this check to avoid calendars bombing when prev month goes + # beyond borders + if {[catch {set prev_month [clock format [clock scan $year-$month-01] -format %Y-%m-%d]} err]} { + return "" + } + + return $prev_month } ad_proc dt_next_month_name { @@ -274,7 +285,13 @@ set month [expr $month + 1] } - return [clock format [clock scan $year-$month-01] -format %B] + # jarkko: added this check to avoid calendars bombing when next month goes + # beyond borders + if {[catch {set next_name [clock format [clock scan $year-$month-01] -format %B]} err]} { + return "" + } + + return $next_name } ad_proc dt_prev_month_name { @@ -290,7 +307,14 @@ set month [expr $month - 1] } - return [clock format [clock scan $year-$month-01] -format %B] + # jarkko: added this check to avoid calendars bombing when prev month goes + # beyond borders + + if {[catch {set prev_name [clock format [clock scan $year-$month-01] -format %B]} err]} { + return "" + } + + return $prev_name } ad_proc -public dt_widget_datetime {