bugfix for duration_only mode #137 (#142)

* replaced durationForEntry with duration filter
* fixed duration problem - fixes #137
This commit is contained in:
Kevin Papst
2018-06-02 19:39:03 +02:00
committed by GitHub
parent 1c0f8cdad1
commit 9d9860e495
10 changed files with 20 additions and 35 deletions

View File

@@ -156,20 +156,12 @@ class Timesheet
/**
* Get duration
* Do not rely on the results of this method for active records.
*
* @return integer
*/
public function getDuration()
{
if ($this->begin === null) {
return 0;
}
if ($this->end === null) {
$current = new \DateTime();
return $current->getTimestamp() - $this->begin->getTimestamp();
}
return $this->duration;
}