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:
e3a83f4
)
SL::DB::CustomVariable: value() für Typ 'date' gefixt
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 17 Feb 2015 12:37:03 +0000
(13:37 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 17 Feb 2015 14:30:32 +0000
(15:30 +0100)
Bisher wurde schlicht das falsche Feld zurückgegeben: text_value. Nun
wird eine Instanz von DateTime zurückgegeben, die auf den Tag
getruncatet ist.
SL/DB/CustomVariable.pm
patch
|
blob
|
history
diff --git
a/SL/DB/CustomVariable.pm
b/SL/DB/CustomVariable.pm
index
560a2de
..
fb990b0
100644
(file)
--- a/
SL/DB/CustomVariable.pm
+++ b/
SL/DB/CustomVariable.pm
@@
-75,9
+75,11
@@
sub value {
my $id = int($self->number_value);
return $id ? SL::DB::Part->new(id => $id)->load() : undef;
+ } elsif ( $type eq 'date' ) {
+ return $self->timestamp_value->clone->truncate(to => 'day');
}
- goto &text_value; # text, textfield
, date
and select
+ goto &text_value; # text, textfield and select
}
sub value_as_text {