From: Bernd Bleßmann Date: Fri, 30 Apr 2021 16:54:36 +0000 (+0200) Subject: Zeiterfassung: Bei Zeitanzeige auch Varianten mit Datum und Dauer berücksichtigen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~283 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=de6f5bd0f8314cee1fa25f4e84a7d1d820b2a1d3;p=kivitendo-erp.git Zeiterfassung: Bei Zeitanzeige auch Varianten mit Datum und Dauer berücksichtigen --- 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;