From 0ffc7f6beb4b051996c5738d02060e44e3fcaf22 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 8 Dec 2015 11:44:39 +0100 Subject: [PATCH] =?utf8?q?Locale::parse=5Fdate=5Fto=5Fobject:=20"yesterday?= =?utf8?q?"=20und=20"today"=20als=20Angaben=20unterst=C3=BCtzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Locale.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SL/Locale.pm b/SL/Locale.pm index 25e804333..8dc95e73c 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -394,6 +394,9 @@ sub parse_date_to_object { return undef if !defined $string; + return DateTime->today_local if lc($string) eq 'today'; + return DateTime->today_local->subtract(days => 1) if lc($string) eq 'yesterday'; + $params{dateformat} ||= $::myconfig{dateformat} || 'yy-mm-dd'; $params{numberformat} ||= $::myconfig{numberformat} || '1,000.00'; my $num_separator = $params{numberformat} =~ m{,\d+$} ? ',' : '.'; -- 2.20.1