Subject: | Setting a date with a 1 digit month causes error |
If you set the date using:
$widget->set(y => 2005, m => 3, d => 3);
then any attempt to drop-down the calendar results in the following message:
Month must be an integer between 1 and 12
This happens because line 578 checks that the input contains only digits and the set method (lines 768-770) pad the input with spaces.
The fix is to use zero padding on the sprintf statements so lines 768-770 become:
$w->{_year} = sprintf( "%04d", $val{y} ) if ( exists $val{y} );
$w->{_month} = sprintf( "%02d", $val{m} ) if ( exists $val{m} );
$w->{_day} = sprintf( "%02d", $val{d} ) if ( exists $val{d} );