From b246e6de1ba8700443d673489c16e742277726dd Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Jan 2021 09:18:45 +0000 Subject: [PATCH] Bug 24850: (QA follow-up) Add more comments To try and clarify the logic here I've added an addition comment to the code. Signed-off-by: David Cook Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/DateUtils.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 11952bc78d..ad242b59eb 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -129,6 +129,9 @@ sub dt_from_string { /xms; # Default to UTC (when 'Z' is passed) for inbound timezone. + # The regex above succeeds for both 'z', 'Z' and '+/-' offset. + # We set tz as though Z was passed by default and then correct it later if an offset is detected + # by the presence fo the variable. $tz = DateTime::TimeZone->new( name => 'UTC' ); } elsif ( $date_format eq 'iso' or $date_format eq 'sql' ) { -- 2.39.5