datetime is jsonserializable, didn't know that :)

This commit is contained in:
Dennis Eichhorn 2019-12-29 14:18:46 +01:00
parent 480fe41eb2
commit f5497970f3
2 changed files with 3 additions and 3 deletions

View File

@ -312,8 +312,8 @@ class Session implements ArrayableInterface, \JsonSerializable
{
return [
'id' => $this->id,
'start' => $this->start->format('Y-m-d H:i:s'),
'end' => $this->end === null ? null : $this->end->format('Y-m-d H:i:s'),
'start' => $this->start,
'end' => $this->end,
'busy' => $this->busy,
'type' => $this->type,
'employee' => $this->employee,

View File

@ -142,7 +142,7 @@ class SessionElement implements ArrayableInterface, \JsonSerializable
return [
'id' => $this->id,
'status' => $this->status,
'dt' => $this->dt->format('Y-m-d H:i:s'),
'dt' => $this->dt,
'session' => \is_int($this->session) ? $this->session : $this->session->getId(),
];
}