Skip Menu |
 

This queue is for tickets about the DateTime-Format-Natural CPAN distribution.

Report information
The Basics
Id: 49326
Status: resolved
Priority: 0/
Queue: DateTime-Format-Natural

People
Owner: Nobody in particular
Requestors: clscott [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.77
Fixed in: (no value)



Subject: Invalid _check_date when Date::Calc is not installed
Download (untitled) / with headers
text/plain 860b
In DateTime/Format/Natural/Compat.pm, there is the following function: sub _check_date { my $self = shift; if ($Pure) { my ($year, $month, $day) = @_; local $@; eval { my $dt = $self->{datetime}->clone; $dt->set_year($year); $dt->set_month($month); $dt->set_day($day); }; return !$@; } else { return check_date(@_); } } This will fail set to $dt->set_month($month) when the current day of the month doesn't exist in $month. For example, trying to check a date of 2009-11-30 on 2009-08-31 will fail because the date 2009-11-31 is invalid. The fix is quite easy: eval { my $dt = $self->{datetime}->clone; $dt->set( year => $year, month => $month, day => $day ); }; Thanks, Clayton
Fixed in v0.78_01. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.