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;