Bugzilla – Attachment 30446 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]
Use floating timezone when handling dates without hours, minutes and seconds.
Use-floating-timezone-when-handling-dates-without-.patch (text/plain), 1.62 KB, created by
Rolando Isidoro
on 2014-08-01 09:09:38 UTC
(
hide
)
Description:
Use floating timezone when handling dates without hours, minutes and seconds.
Filename:
MIME Type:
Creator:
Rolando Isidoro
Created:
2014-08-01 09:09:38 UTC
Size:
1.62 KB
patch
obsolete
>From f0f8ab994d689faa12baa47a94fc9e345be68cdc 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] Use floating timezone when handling dates without hours, > minutes and seconds. >Content-Type: text/plain; charset="utf-8" > >http://bugs.koha-community.org/show_bug.cgi?id=12669 >--- > Koha/DateUtils.pm | 3 ++- > Koha/Template/Plugin/KohaDates.pm | 5 ++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index b372a3a..a993ffe 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -123,7 +123,8 @@ sub output_pref { > > return unless defined $dt; > >- $dt->set_time_zone( C4::Context->tz ); >+ 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.9.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 12669
:
30268
|
30446
|
30474
|
30985
|
31623
|
33914
|
33915
|
35389
|
35390
|
36011
|
36012
|
36068
|
36069