small bugfixes (#2655)
* improve report visibility * fix timesheet duration, which breaks validation * added contributing section in README * do not allow to change project for existing activities - fixes #2576 * bump theme version to fix FOSUserBundle dependency * use entity color instead of inherited one - fixes #2200
This commit is contained in:
@@ -411,6 +411,11 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
|
||||
*/
|
||||
public function getDuration(): ?int
|
||||
{
|
||||
// only auto calculate if manually set duration is null - the result is important for eg. validations
|
||||
if ($this->duration === null && $this->begin !== null && $this->end !== null) {
|
||||
return $this->end->getTimestamp() - $this->begin->getTimestamp();
|
||||
}
|
||||
|
||||
return $this->duration;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user