Tk Library Source Code
Artifact [dc211b7213]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

Artifact dc211b721362ac4b56ee48bcc605e25622bbfbf6d8fd13cc8becb64c8ad861a5:

Attachment "calendar.diff" to ticket [c800a75eb5] added by emiliano 2025-11-05 14:25:24.
Index: modules/widget/calendar.tcl
==================================================================
--- modules/widget/calendar.tcl
+++ modules/widget/calendar.tcl
@@ -542,11 +542,14 @@
 	# Replace month/year and do any necessary substs
 	return [subst [string map [list %m $month %Y $year] $format]]
     }
 
     method numberofdays {month year} {
-	if {$month == 12} {set month 0; incr year}
+	if {$month > 11} {
+	    set month [expr {$month % 12}]
+	    incr year
+	}
 	clock format [clock scan "[incr month]/1/$year	1 day ago"] -format %d
     }
 
     method lcycle _list {
 	upvar $_list list