Subject: | 29 feb 2009 -> to_datetime fails... |
Hi Flavio
I'm using your module with pleasure, but I have a little concern.
we are in 2009. If I make the test
my $dti = DateTime::Incomplete->new( month => 2, day => 29, year=>2000);
ok($dti->to_datetime(), "29 feb 2000");
I get...
Invalid day of month (day = 29 - month = 2 - year = 2009)
at /Library/Perl/5.8.8/DateTime/Incomplete.pm line 639
looking around line 639
for $key ( <b>reverse @FIELDS_SORTED</b> )
{
$value = $self->{has}{$key};
next unless defined $value;
if ( $key eq 'time_zone' )
{
$result->set_time_zone( $value );
next;
}
$result->set( $key => $value );
}
and the year is set at the end of the process, thus is 2009 when 29th of
feb is set => error!!!!
I you wrote the code in 2008, you had not hit that problem...
cheers
Alex