X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/33823a7743de188f6e37802716ee5bd877a3ec5f..662df9d7fdc9c953d324a975a5bf554e6534c42e:/SL/DB/TimeRecording.pm diff --git a/SL/DB/TimeRecording.pm b/SL/DB/TimeRecording.pm index 9b1a2e351..13329b782 100644 --- a/SL/DB/TimeRecording.pm +++ b/SL/DB/TimeRecording.pm @@ -115,11 +115,19 @@ sub is_duration_used { sub displayable_times { my ($self) = @_; - # placeholder - my $ph = $::locale->format_date_object(DateTime->new(year => 1111, month => 11, day => 11, hour => 11, minute => 11), precision => 'minute'); - $ph =~ s{1}{-}g; + my $text; - return ($self->start_time_as_timestamp||$ph) . ' - ' . ($self->end_time_as_timestamp||$ph); + if ($self->is_duration_used) { + $text = $self->date_as_date . ': ' . ($self->duration_as_duration_string || '--:--'); + + } else { + # placeholder + my $ph = $::locale->format_date_object(DateTime->new(year => 1111, month => 11, day => 11, hour => 11, minute => 11), precision => 'minute'); + $ph =~ s{1}{-}g; + $text = ($self->start_time_as_timestamp||$ph) . ' - ' . ($self->end_time_as_timestamp||$ph); + } + + return $text; } 1;