Bugzilla – Attachment 37093 Details for
Bug 13601
Get rid of DateTime::Format::DateParse
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13601: The fallback regex should contain the time part
PASSED-QA-Bug-13601-The-fallback-regex-should-cont.patch (text/plain), 2.10 KB, created by
Katrin Fischer
on 2015-03-22 19:57:21 UTC
(
hide
)
Description:
[PASSED QA] Bug 13601: The fallback regex should contain the time part
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-03-22 19:57:21 UTC
Size:
2.10 KB
patch
obsolete
>From a5ec4114e3013399e5a37c95f23753e903827143 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 17 Mar 2015 09:44:30 +0100 >Subject: [PATCH] [PASSED QA] Bug 13601: The fallback regex should contain the > time part >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >On displaying a sql date, if the dateformat is not set to sql, the >output should contain the date. >In the previous version, the fallback regex (used for sql format) did not >included the time part (hh:mm:ss). > >Checked out an item with due date an ddue time. Time displays as expected. >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/DateUtils.pm | 4 +++- > t/DateUtils.t | 6 +++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 3f44f83..7a98120 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -105,7 +105,7 @@ sub dt_from_string { > } > > # Add the faculative time part [hh:mm[:ss]] >- $regex .= qr| >+ my $time_re .= qr| > ( > \s* > (?<hour>\d{2}) >@@ -117,6 +117,8 @@ sub dt_from_string { > )? > )? > |xms; >+ $regex .= $time_re; >+ $fallback_re .= $time_re; > > my %dt_params; > if ( $date_string =~ $regex ) { >diff --git a/t/DateUtils.t b/t/DateUtils.t >index 7705fd4..1af4268 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -3,7 +3,7 @@ use DateTime; > use DateTime::TimeZone; > > use C4::Context; >-use Test::More tests => 54; >+use Test::More tests => 55; > use Test::MockModule; > use Time::HiRes qw/ gettimeofday /; > use t::lib::Mocks; >@@ -211,3 +211,7 @@ is( output_pref( { dt => $dt } ), '31/01/2015 12:34', 'dt_from_string should mat > # date before 1900 > $dt = dt_from_string('01/01/1900'); > is( output_pref( { dt => $dt, dateonly => 1 } ), '01/01/1900', 'dt_from_string should manage date < 1900' ); >+ >+# fallback >+$dt = dt_from_string('2015-01-31 01:02:03'); >+is( output_pref( {dt => $dt} ), '31/01/2015 01:02', 'dt_from_string should fallback to sql format' ); >-- >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 13601
:
35405
|
35406
|
35407
|
35408
|
35433
|
36733
|
36734
|
36735
|
36736
|
36737
|
36745
|
36746
|
36747
|
36748
|
36754
|
36755
|
36756
|
36928
|
36933
|
36939
|
37023
|
37087
|
37088
|
37089
|
37090
|
37091
|
37092
| 37093