Bugzilla – Attachment 36068 Details for
Bug 12669
"Template process failed: undef error - Invalid local time for date in time zone"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12669: Use floating timezone when handling dates without hours, minutes and seconds.
PASSED-QA-Bug-12669-Use-floating-timezone-when-han.patch (text/plain), 2.70 KB, created by
Kyle M Hall (khall)
on 2015-02-20 11:57:25 UTC
(
hide
)
Description:
[PASSED QA] Bug 12669: Use floating timezone when handling dates without hours, minutes and seconds.
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-02-20 11:57:25 UTC
Size:
2.70 KB
patch
obsolete
>From 93f4bfbe51770a57e040a21dc42850bd2c4cb424 Mon Sep 17 00:00:00 2001 >From: Rolando Isidoro <rolando.isidoro@gmail.com> >Date: Fri, 1 Aug 2014 09:42:30 +0100 >Subject: [PATCH] [PASSED QA] Bug 12669: Use floating timezone when handling dates without hours, minutes and seconds. > >Test plan: > >1. Create a new serial record or pick an existing one; >2. Add a "New subscription" and set the "First issue publication date" > and "Frequency" values so that the "Planned date" for a given issue > hits a day where a transition to Daylight Saving Time (DST) occurs > > ex:. 1979-04-01 in Europe/Lisbon (http://www.timeanddate.com/time/change/portugal/lisbon?year=1979) > ... use this website page as a source http://www.timeanddate.com/time/dst/2014.html > to find a suitable transition to DST in your timezone in the current year. > >3. From the "Subscription detail" page in Koha for the given record click > the "Serial collection" link on the left side context menu. > >Expected result: >Prior to applying the patch the error described in this bug report should occur. >After the patch is applied the "Serial collection" page should load correctly. > >Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/DateUtils.pm | 5 ++++- > Koha/Template/Plugin/KohaDates.pm | 5 ++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 4358137..001d7ab 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -129,7 +129,10 @@ sub output_pref { > return unless defined $dt; > > # FIXME: see bug 13242 => no TZ for dates 'infinite' >- $dt->set_time_zone( C4::Context->tz ) if $dt->ymd !~ /^9999/; >+ if ( $dt->ymd !~ /^9999/ ) { >+ my $tz = $dateonly ? DateTime::TimeZone->new(name => 'floating') : C4::Context->tz; >+ $dt->set_time_zone( $tz ); >+ } > > my $pref = > defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); >diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm >index 37d03af..b4c1d8d 100644 >--- a/Koha/Template/Plugin/KohaDates.pm >+++ b/Koha/Template/Plugin/KohaDates.pm >@@ -29,7 +29,10 @@ sub filter { > my ( $self, $text, $args, $config ) = @_; > return "" unless $text; > $config->{with_hours} //= 0; >- my $dt = dt_from_string( $text, 'iso' ); >+ >+ my $tz = DateTime::TimeZone->new(name => 'floating') unless $config->{with_hours}; >+ my $dt = dt_from_string( $text, 'iso', $tz ); >+ > return $config->{as_due_date} ? > output_pref({ dt => $dt, as_due_date => 1 }) : > output_pref({ dt => $dt, dateonly => !$config->{with_hours} }); >-- >1.7.2.5
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 12669
:
30268
|
30446
|
30474
|
30985
|
31623
|
33914
|
33915
|
35389
|
35390
|
36011
|
36012
| 36068 |
36069