womtfix/negative-werte #12

Merged
TorstenHettstedt merged 4 commits from womtfix/negative-werte into master 2021-04-15 12:25:33 +02:00
Showing only changes of commit 2b2753e009 - Show all commits
+2 -1
View File
@@ -91,12 +91,13 @@ class WorkingHoursView implements ModelInterface
'overtime' => "string" 'overtime' => "string"
])] public function jsonSerialize(): array ])] public function jsonSerialize(): array
{ {
$formatOvertime = (($this->getOvertime()->invert === 1) ? '-' : '') . '%H:%I:%S';
return [ return [
'period' => $this->getPeriod()->format($this->getPeriodDesignation()->getValue()), 'period' => $this->getPeriod()->format($this->getPeriodDesignation()->getValue()),
'periodDesignation' => strtolower($this->getPeriodDesignation()->getKey()), 'periodDesignation' => strtolower($this->getPeriodDesignation()->getKey()),
'workingDays' => $this->getWorkingDays(), 'workingDays' => $this->getWorkingDays(),
'totalHours' => $this->getTotalHours()->format('%H:%I:%S'), 'totalHours' => $this->getTotalHours()->format('%H:%I:%S'),
'overtime' => $this->getOvertime()->format('%H:%I:%S') 'overtime' => $this->getOvertime()->format($formatOvertime)
]; ];
} }
} }