projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f0c7d8
)
Locale::parse_date_to_object: "yesterday" und "today" als Angaben unterstützen
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 8 Dec 2015 10:44:39 +0000
(11:44 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 8 Dec 2015 10:45:23 +0000
(11:45 +0100)
SL/Locale.pm
patch
|
blob
|
history
diff --git
a/SL/Locale.pm
b/SL/Locale.pm
index
25e8043
..
8dc95e7
100644
(file)
--- 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+$} ? ',' : '.';