From 2b2753e0096bad058357a6950a2159dc99edc688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20L=C3=BCcke?= Date: Thu, 15 Apr 2021 11:34:50 +0200 Subject: [PATCH] Die Darstellung von negativen Werten erfolgt richtig. --- api/src/Models/WorkingHoursView.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/Models/WorkingHoursView.php b/api/src/Models/WorkingHoursView.php index fdfa397..b229ec8 100644 --- a/api/src/Models/WorkingHoursView.php +++ b/api/src/Models/WorkingHoursView.php @@ -91,12 +91,13 @@ class WorkingHoursView implements ModelInterface 'overtime' => "string" ])] public function jsonSerialize(): array { + $formatOvertime = (($this->getOvertime()->invert === 1) ? '-' : '') . '%H:%I:%S'; return [ 'period' => $this->getPeriod()->format($this->getPeriodDesignation()->getValue()), 'periodDesignation' => strtolower($this->getPeriodDesignation()->getKey()), 'workingDays' => $this->getWorkingDays(), 'totalHours' => $this->getTotalHours()->format('%H:%I:%S'), - 'overtime' => $this->getOvertime()->format('%H:%I:%S') + 'overtime' => $this->getOvertime()->format($formatOvertime) ]; } } \ No newline at end of file