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:
9516abf
)
Zeiterfassung: Bei Zeitanzeige auch Varianten mit Datum und Dauer berücksichtigen
author
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Fri, 30 Apr 2021 16:54:36 +0000
(18:54 +0200)
committer
Bernd Bleßmann
<bernd@kivitendo-premium.de>
Wed, 5 May 2021 15:25:03 +0000
(17:25 +0200)
SL/DB/TimeRecording.pm
patch
|
blob
|
history
diff --git
a/SL/DB/TimeRecording.pm
b/SL/DB/TimeRecording.pm
index
9b1a2e3
..
13329b7
100644
(file)
--- a/
SL/DB/TimeRecording.pm
+++ b/
SL/DB/TimeRecording.pm
@@
-115,11
+115,19
@@
sub is_duration_used {
sub displayable_times {
my ($self) = @_;
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;
}
1;