From 2bb1c9616f0fe4c8c1d39574a99eff02a7ece42e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 17 Feb 2015 13:38:25 +0100 Subject: [PATCH] =?utf8?q?SL::DB::CustomVariable:=20value=5Fas=5Ftext()=20?= =?utf8?q?f=C3=BCr=20Typ=20'date'=20gefixt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bisher wurde schlicht das falsche Feld zurückgegeben: text_value. Nun wird das formatierte Datum aus timestamp_value zurückgegeben. --- SL/DB/CustomVariable.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 7f18f6a8d..3f1f7a2e3 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -91,7 +91,7 @@ sub value_as_text { if ($type eq 'bool') { return $self->bool_value ? $::locale->text('Yes') : $::locale->text('No'); - } elsif ($type eq 'timestamp') { + } elsif ($type =~ m{^(?:timestamp|date)}) { return $::locale->reformat_date( { dateformat => 'yy-mm-dd' }, $self->timestamp_value->ymd, $::myconfig{dateformat}); } elsif ($type eq 'number') { return $::form->format_amount(\%::myconfig, $self->number_value, $cfg->processed_options->{PRECISION}); @@ -115,7 +115,7 @@ sub value_as_text { return $part ? $part->description : ''; } - goto &text_value; # text, textfield, date and select + goto &text_value; # text, textfield and select } sub is_valid { -- 2.20.1