Bug 27249: Replace DateTime->now by dt_from_string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a2288052d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff565dd3b8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Julian Maurice 2023-10-10 11:53:17 +02:00 committed by Matt Blenkinsop
parent 312b0cd23c
commit bafd8a47e3

View file

@ -289,7 +289,7 @@ subtest 'with a library that is never open' => sub {
$calendar->insert_week_day_holiday( weekday => $weekday, title => '', description => '' );
}
my $now = DateTime->now;
my $now = dt_from_string;
subtest 'next_open_days should throw an exception' => sub {
my $kcalendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => 'Calendar' );
@ -315,7 +315,7 @@ subtest 'with a library that is *almost* never open' => sub {
$calendar->insert_week_day_holiday( weekday => $weekday, title => '', description => '' );
}
my $now = DateTime->now;
my $now = dt_from_string;
my $open_day_in_the_future = $now->clone()->add( years => 1 );
my $open_day_in_the_past = $now->clone()->subtract( years => 1 );
$calendar->insert_exception_holiday( date => $open_day_in_the_future->ymd, title => '', description => '' );