Skip Menu |

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

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

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

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



Subject: Tests fail on when running on 31st of any month
Because there's no 31st day in november and the test is creating a datetime object of now and then setting month before setting the day.
Subject: dtfn.patch
diff -ur lib.orig/DateTime/Format/Natural.pm lib/DateTime/Format/Natural.pm --- lib.orig/DateTime/Format/Natural.pm 2007-05-31 16:44:58.000000000 -0400 +++ lib/DateTime/Format/Natural.pm 2007-05-31 16:46:47.000000000 -0400 @@ -410,16 +410,14 @@ sub _set_datetime { my ($self, $year, $month, $day, $hour, $min, $sec) = @_; - $self->{datetime} = DateTime->now(time_zone => 'floating'); - + $self->{datetime} = DateTime->new(time_zone => 'floating', + year => $year, + month => $month, + day => $day, + hour => $hour, + minute => $min, + second => $sec); $self->{nodatetimeset} = 1; - - $self->{datetime}->set_year($year); - $self->{datetime}->set_month($month); - $self->{datetime}->set_day($day); - $self->{datetime}->set_hour($hour); - $self->{datetime}->set_minute($min); - $self->{datetime}->set_second($sec); } 1;
On Thu May 31 16:51:39 2007, CLKAO wrote: Show quoted text
> Because there's no 31st day in november and the test is creating a > datetime object of now and then setting month before setting the day.
Thanks, applied.