From dbb50ddae99cfaa1b86fb1dbfe2f87363b408a78 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 24 Feb 2026 13:23:16 +0000 Subject: [PATCH] Bug 14962: (QA follow-up) Use dt_from_string instead of DateTime->today in Displays->active DateTime->today uses the system timezone rather than the Koha-configured timezone, which can cause incorrect date comparisons for libraries that configure a timezone different from the server's local time. Use Koha::DateUtils::dt_from_string, which is the standard Koha convention and is consistent with every other date comparison in this feature. Sponsored-by: ByWater Solutions Signed-of-by: Martin Renvoize --- Koha/Displays.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Displays.pm b/Koha/Displays.pm index e91483a55e5..05ce9a061ec 100644 --- a/Koha/Displays.pm +++ b/Koha/Displays.pm @@ -20,9 +20,9 @@ package Koha::Displays; use Modern::Perl; use Carp; -use DateTime; use Koha::Database; +use Koha::DateUtils qw( dt_from_string ); use Koha::Display; use base qw(Koha::Objects); @@ -73,7 +73,7 @@ Returns displays that are currently active (enabled and within date range if spe sub active { my ($self) = @_; - my $today = DateTime->today->ymd; + my $today = dt_from_string()->truncate( to => 'day' )->ymd; return $self->search( { -- 2.53.0