From 19f1a182f7ed42386d11037a01f3c58d8dd14a22 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 31 May 2016 13:12:25 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 16624 - Times are formatted incorrectly in slips ( AM PM ) due to double processing To test: 1 - Checkout an item (with default time 11:59:00 PM) 2 - Generate a quickslip 3 - Notice the time is 'AM' 4 - Apply patch 5 - Generate quickslip 6 - Note time is correct Signed-off-by: Jason Burds --- C4/Letters.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index f327890..2e1f8bb 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -847,6 +847,10 @@ sub _parseletter { my $dateonly = defined $1 ? 0 : 1; #$1 refers to the capture group wrapped in parentheses. In this case, that's the hours, minutes, seconds. my $re_dateonly_filter = qr{ $field( \s* \| \s* dateonly\s*)?>> }xms; + eval { + $replacedby = output_pref({ dt => dt_from_string( $replacedby ), dateonly => $dateonly }); + }; + for my $letter_field ( qw( title content ) ) { my $filter_string_used = q{}; if ( $letter->{ $letter_field } =~ $re_dateonly_filter ) { @@ -854,9 +858,6 @@ sub _parseletter { $filter_string_used = $1 || q{}; $dateonly = $1 unless $dateonly; } - eval { - $replacedby = output_pref({ dt => dt_from_string( $replacedby ), dateonly => $dateonly }); - }; if ( $letter->{ $letter_field } ) { $letter->{ $letter_field } =~ s/\Q<<$table.$field$filter_string_used>>\E/$replacedby/g; -- 2.1.4