• Re: Bug in widget::calendar

    From Mark Summerfield@[email protected] to comp.lang.tcl on Wed Nov 5 17:53:56 2025
    From Newsgroup: comp.lang.tcl

    On Wed, 5 Nov 2025 12:22:25 -0300, Emiliano wrote:

    On Wed, 5 Nov 2025 12:39:43 -0000 (UTC)
    Mark Summerfield <[email protected]> wrote:

    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.

    The problem is the validating nature (by default) of the [clock scan]
    command in Tcl 9.

    See tklib's ticket https://core.tcl-lang.org/tklib/tktview/c800a75eb5

    Thank you. I tried your patch and that bug no longer occurs.
    --- Synchronet 3.21a-Linux NewsLink 1.2