Bugzilla – Attachment 43434 Details for
Bug 14950
A date is not correctly filled in default values from batch mod [was Remove C4::Dates from tools/batchMod.pl]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14922: Fix day formatting if < 10
Bug-14922-Fix-day-formatting-if--10.patch (text/plain), 1.61 KB, created by
Jonathan Druart
on 2015-10-15 12:54:21 UTC
(
hide
)
Description:
Bug 14922: Fix day formatting if < 10
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-15 12:54:21 UTC
Size:
1.61 KB
patch
obsolete
>From be2da51f645faa15287dbbcf32d8caea3231f725 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 15 Oct 2015 13:50:44 +0100 >Subject: [PATCH] Bug 14922: Fix day formatting if < 10 > >$dt->day return a single digit if < 10, we want to display it on 2 >digits > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >http://bugs.koha-community.org/show_bug.cgi?id=14950 >--- > tools/batchMod.pl | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index af2ae4b..b31f93d 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -332,13 +332,11 @@ foreach my $tag (sort keys %{$tagslib}) { > if ( !$value && $use_default_values) { > $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; > # get today date & replace YYYY, MM, DD if provided in the default value >- my $today = dt_from_string; >- my $year = $today->year; >- my $month = $today->month; >- my $day = $today->day; >- $value =~ s/YYYY/$year/g; >- $value =~ s/MM/$month/g; >- $value =~ s/DD/$day/g; >+ my $today_iso = output_pref( { dt=>dt_from_string, dateonly => 1, dateformat => 'iso' } ); >+ my ( $year, $month, $day ) = split ('-', $today_iso); >+ $value =~ s/YYYY/$year/g; >+ $value =~ s/MM/$month/g; >+ $value =~ s/DD/$day/g; > } > $subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4)); > # testing branch value if IndependentBranches. >-- >2.1.0
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 14950
:
43095
|
43106
|
43155
|
43156
| 43434