From Newsgroup: comp.lang.tcl
* Mark Summerfield <
m.n.summerfield@gmail.com>
| I have a Tcl/Tk 9 application which has a form with a widget::dateentry.
| When I have a date of 12/11/2025 (with format %d/%m/%Y) and click it
| the widget::calendar pops up as expected showing November 2025.
| If I then click the small right arrow (advance one month) it correctly
| shows me December 2025.
| If I then click the small right arrow a second time I get this error:
| unable to convert input string: invalid month
| unable to convert input string: invalid month
| while executing
| "clock scan "[incr month]/1/$year 1 day ago""
| (procedure "::widget::calendar::Snit_methodnumberofdays" line 8)
| invoked from within
| "$self numberofdays $data(month) $data(year)"
| (procedure "::widget::calendar::Snit_methodadjust" line 44)
| invoked from within
| ".mf.mpw.lpw.iw#9.titlebar.date.__drop.calendar adjust 0 1 0"
| ("uplevel" body line 1)
| invoked from within
| "uplevel 1 [linsert $args 0 $self]"
| invoked from within
| "::snit::RT.CallInstance ::widget::calendar::Snit_inst10 adjust 0 1 0"
| (command bound to event)
| I am using tklib-0.9.
Can't reproduce here with tk 8.6.17 and tklib-0.9 (trunk 2025-10-22).
% package require widget::dateentry
0.98
% pack [widget::dateentry .d -dateformat %d/%m/%Y]
I can click the arrows (big and small) any number of times in any
direction, no error.
I'd add some printout in tklib/widget/calendar.tcl, method numberofdays,
to see the variables when entering the function.
method numberofdays {month year} {
puts stderr "method numberofdays: 1/ month {$month} year {$year}"
if {$month == 12} {set month 0; incr year}
puts stderr "method numberofdays: 2/ month {$month} year {$year}"
clock format [clock scan "[incr month]/1/$year 1 day ago"] -format %d
}
HTH
R'
--- Synchronet 3.21a-Linux NewsLink 1.2