calculate duration for running entries on the fly

This commit is contained in:
Kevin Papst
2018-01-02 14:23:29 +01:00
parent efa3646cbe
commit a31f78d966

View File

@@ -151,7 +151,12 @@ class Timesheet
*/ */
public function getDuration() public function getDuration()
{ {
return $this->duration; if ($this->duration !== 0 || $this->begin === null) {
return $this->duration;
}
$current = new \DateTime();
return $current->getTimestamp() - $this->begin->getTimestamp();
} }
/** /**