Bugzilla – Attachment 23914 Details for
Bug 11468
Remove use of smartmatch from DateUtils
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11468 Remove given when from Koha::Dateutils
PASSED-QA-Bug-11468-Remove-given-when-from-KohaDat.patch (text/plain), 2.25 KB, created by
Katrin Fischer
on 2014-01-05 22:55:56 UTC
(
hide
)
Description:
[PASSED QA] Bug 11468 Remove given when from Koha::Dateutils
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-01-05 22:55:56 UTC
Size:
2.25 KB
patch
obsolete
>From 50cc1e5adfed9c6334aff0b5ceeafc7cdfa68af2 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 2 Jan 2014 14:42:16 +0000 >Subject: [PATCH] [PASSED QA] Bug 11468 Remove given when from Koha::Dateutils > >given and when give warnings due to their experimental >status as of perl 5.18. Replace the construct with >an if/elsif to avoid the keywords > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Passes all tests and QA script, especially t/DateUtils.t. >--- > Koha/DateUtils.pm | 43 ++++++++++++++++++++----------------------- > 1 file changed, 20 insertions(+), 23 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 4ae0d0c..ea57778 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -130,31 +130,28 @@ sub output_pref { > my $time_format = $force_time || C4::Context->preference('TimeFormat'); > my $time = ( $time_format eq '12hr' ) ? '%I:%M %p' : '%H:%M'; > >- given ($pref) { >- when (/^iso/) { >- return $dateonly >- ? $dt->strftime("%Y-%m-%d") >- : $dt->strftime("%Y-%m-%d $time"); >- } >- when (/^metric/) { >- return $dateonly >- ? $dt->strftime("%d/%m/%Y") >- : $dt->strftime("%d/%m/%Y $time"); >- } >- when (/^us/) { >- >- return $dateonly >- ? $dt->strftime("%m/%d/%Y") >- : $dt->strftime("%m/%d/%Y $time"); >- } >- default { >- return $dateonly >- ? $dt->strftime("%Y-%m-%d") >- : $dt->strftime("%Y-%m-%d $time"); >- } >+ if ( $pref =~ m/^iso/ ) { >+ return $dateonly >+ ? $dt->strftime("%Y-%m-%d") >+ : $dt->strftime("%Y-%m-%d $time"); >+ } >+ elsif ( $pref =~ m/^metric/ ) { >+ return $dateonly >+ ? $dt->strftime("%d/%m/%Y") >+ : $dt->strftime("%d/%m/%Y $time"); >+ } >+ elsif ( $pref =~ m/^us/ ) { > >+ return $dateonly >+ ? $dt->strftime("%m/%d/%Y") >+ : $dt->strftime("%m/%d/%Y $time"); > } >- return; >+ else { >+ return $dateonly >+ ? $dt->strftime("%Y-%m-%d") >+ : $dt->strftime("%Y-%m-%d $time"); >+ } >+ > } > > =head2 output_pref_due >-- >1.8.3.2
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 11468
:
23894
|
23905
| 23914