You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2011/09/21 19:31:48 UTC

svn commit: r1173771 - in /tcl/rivet/branches/2.0: ChangeLog rivet/packages/calendar/calendar.tcl

Author: mxmanghi
Date: Wed Sep 21 17:31:48 2011
New Revision: 1173771

URL: http://svn.apache.org/viewvc?rev=1173771&view=rev
Log:
* rivet/packages/calendar/calendar.tcl: fixed wrong conversion of month expressed as numeric string

Modified:
    tcl/rivet/branches/2.0/ChangeLog
    tcl/rivet/branches/2.0/rivet/packages/calendar/calendar.tcl

Modified: tcl/rivet/branches/2.0/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/ChangeLog?rev=1173771&r1=1173770&r2=1173771&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/ChangeLog (original)
+++ tcl/rivet/branches/2.0/ChangeLog Wed Sep 21 17:31:48 2011
@@ -1,3 +1,6 @@
+2011-09-21 Massimo Manghi <mx...@apache.org>
+    * rivet/packages/calendar/calendar.tcl: fixed wrong conversion of month expressed as numeric string
+
 2011-09-20 Massimo Manghi <mx...@apache.org>
     * src/apache-2/rivetCore.c: inclusion of apr_strings.h added.
 

Modified: tcl/rivet/branches/2.0/rivet/packages/calendar/calendar.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/rivet/packages/calendar/calendar.tcl?rev=1173771&r1=1173770&r2=1173771&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/rivet/packages/calendar/calendar.tcl (original)
+++ tcl/rivet/branches/2.0/rivet/packages/calendar/calendar.tcl Wed Sep 21 17:31:48 2011
@@ -280,8 +280,9 @@ package require Itcl
 	    set month [lindex $numeric_parameters 0]
 	    set year  [lindex $numeric_parameters 1]	    
 
-	    if  {[regexp {^\d{1,2}$} $month mat] && ($month > 0) && ($month <= 12)} {
-		return [cal [incr month -1] $year]
+	    if  {[regexp {^\d{1,2}$} $month matched_month] && ($month > 0) && ($month <= 12)} {
+	    	scan $month "%d" matched_month
+		return [cal [incr matched_month -1] $year]
 	    } elseif { [lsearch $month_names($language) $month] >= 0} {
 		return [cal [lsearch $month_names($language) $month] $year]
 	    }
@@ -293,7 +294,8 @@ package require Itcl
 
 	    set month [clock format [clock sec] -format %m]
 	    set year [clock format [clock sec] -format %Y]
-	    return [cal [incr month -1] $year]
+	    scan $month "%d" matched_month
+	    return [cal [incr matched_month -1] $year]
 	}
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org