calculate duration for running entries on the fly
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user