Revision 01a428f7
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
SL/DB/CustomVariable.pm | ||
---|---|---|
76 | 76 |
my $id = int($self->number_value); |
77 | 77 |
return $id ? SL::DB::Part->new(id => $id)->load() : undef; |
78 | 78 |
} elsif ( $type eq 'date' ) { |
79 |
return $self->timestamp_value->clone->truncate(to => 'day');
|
|
79 |
return $self->timestamp_value ? $self->timestamp_value->clone->truncate(to => 'day') : undef;
|
|
80 | 80 |
} |
81 | 81 |
|
82 | 82 |
goto &text_value; # text, textfield and select |
... | ... | |
92 | 92 |
if ($type eq 'bool') { |
93 | 93 |
return $self->bool_value ? $::locale->text('Yes') : $::locale->text('No'); |
94 | 94 |
} elsif ($type =~ m{^(?:timestamp|date)}) { |
95 |
return '' if !$self->timestamp_value; |
|
95 | 96 |
return $::locale->reformat_date( { dateformat => 'yy-mm-dd' }, $self->timestamp_value->ymd, $::myconfig{dateformat}); |
96 | 97 |
} elsif ($type eq 'number') { |
97 | 98 |
return $::form->format_amount(\%::myconfig, $self->number_value, $cfg->processed_options->{PRECISION}); |
Auch abrufbar als: Unified diff
SL::DB::CustomVariable: value, value_as_text für Typ 'date/timestamp' und ungesetzt gefixt