From 4cfb5a61cd092f657aa2b45f8765515bed41facd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Nov 2015 12:40:52 +0000 Subject: [PATCH] Bug 14998: Restore previous behavior We want to convert a us or metric date formatted to the format defined in the pref. Signed-off-by: Jonathan Druart --- misc/maintenance/fix_accountlines_date.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/maintenance/fix_accountlines_date.pl b/misc/maintenance/fix_accountlines_date.pl index e0c97f6..470b84b 100755 --- a/misc/maintenance/fix_accountlines_date.pl +++ b/misc/maintenance/fix_accountlines_date.pl @@ -146,14 +146,14 @@ while (my $accountline = $sth->fetchrow_hashref) { if ($mode eq 'us') { if ($description =~ /$US_DATE/) { # mm/dd/yyyy - my $date = eval { output_pref( { dt => dt_from_string( $1 ), dateonly => 1, dateformat => 'us' } ); }; + my $date = output_pref( { dt => dt_from_string( $1, 'us' ), dateonly => 1} ); print "Converting $1 (us) to " . $date . "\n" if $DEBUG;i $description =~ s/$US_DATE/$date/; $updated = 1; } } elsif ($mode eq 'metric') { if ($description =~ /$METRIC_DATE/) { # dd/mm/yyyy - my $date = eval { output_pref( { dt => dt_from_string( $1 ), dateonly => 1, dateformat => 'metric' } ); }; + my $date = output_pref( { dt => dt_from_string( $1, 'metric' ), dateonly => 1} ); print "Converting $1 (metric) to " . $date . "\n" if $DEBUG; $description =~ s/$METRIC_DATE/$date/; $updated = 2; -- 2.1.0