Bugzilla – Attachment 101808 Details for
Bug 24850
Koha::DateUtils ignores offsets in RFC3339 datetimes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24850: Continue to handle default time and daylight saving
Bug-24850-Continue-to-handle-default-time-and-dayl.patch (text/plain), 1.71 KB, created by
Martin Renvoize (ashimema)
on 2020-03-26 11:14:36 UTC
(
hide
)
Description:
Bug 24850: Continue to handle default time and daylight saving
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-26 11:14:36 UTC
Size:
1.71 KB
patch
obsolete
>From 3b1ce35a995518e7d1dfe3f337984ce6dd6b7ecb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 26 Mar 2020 11:12:26 +0000 >Subject: [PATCH] Bug 24850: Continue to handle default time and daylight > saving > >This patch prevents the call to set_time_zone if we are handling a >dateonly datetime string or a DST time >--- > Koha/DateUtils.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index e7923fcca5..4c92d1d88c 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -181,10 +181,14 @@ sub dt_from_string { > $dt_params{day} = '01' if $dt_params{day} eq '00'; > > # Set default hh:mm:ss to 00:00:00 >+ my $date_only = ( !defined( $dt_params{hour} ) >+ && !defined( $dt_params{minute} ) >+ && !defined( $dt_params{second} ) ); > $dt_params{hour} = 00 unless defined $dt_params{hour}; > $dt_params{minute} = 00 unless defined $dt_params{minute}; > $dt_params{second} = 00 unless defined $dt_params{second}; > >+ my $floating = 0; > my $dt = eval { > DateTime->new( > %dt_params, >@@ -194,13 +198,17 @@ sub dt_from_string { > }; > if ($@) { > $tz = DateTime::TimeZone->new( name => 'floating' ); >+ $floating = 1; > $dt = DateTime->new( > %dt_params, > # No TZ for dates 'infinite' => see bug 13242 > ( $dt_params{year} < 9999 ? ( time_zone => $tz ) : () ), > ); > } >- $dt->set_time_zone($server_tz); >+ >+ # Convert to configured timezone (unless we started with a dateonly string or had to drop to floating time) >+ $dt->set_time_zone($server_tz) unless ( $date_only || $floating ); >+ > return $dt; > } > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24850
:
100585
|
100586
|
100587
|
100592
|
100593
|
100594
|
100595
|
100678
|
100679
|
100680
|
100681
|
100881
|
100901
|
100902
|
100903
|
100904
|
100905
|
101803
|
101804
|
101805
|
101806
|
101807
|
101808
|
101837
|
101838
|
101839
|
101840
|
101841
|
101842
|
101843
|
101844
|
115851
|
115852
|
115853
|
115854
|
115855
|
115856
|
115857
|
116299
|
116300
|
116301
|
116302
|
116303
|
116304
|
116305
|
116355
|
116356
|
116357
|
116358
|
116359
|
116360
|
116361
|
116511
|
126182
|
126183
|
126184
|
126185
|
126186
|
126187
|
126188
|
126189
|
127231
|
127232
|
127235
|
127236
|
127239
|
127240
|
127241
|
127242
|
127243
|
127244