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>
This commit is contained in:
Julian Maurice 2023-10-10 11:53:17 +02:00 committed by Tomas Cohen Arazi
parent 9e2a258f6f
commit 1a2288052d
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

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 => '' );