From f5497970f3cc262f1d5345dcc46d4135d6da3936 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 29 Dec 2019 14:18:46 +0100 Subject: [PATCH] datetime is jsonserializable, didn't know that :) --- Models/Session.php | 4 ++-- Models/SessionElement.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Models/Session.php b/Models/Session.php index 0fdcc73..b9d71bb 100644 --- a/Models/Session.php +++ b/Models/Session.php @@ -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, diff --git a/Models/SessionElement.php b/Models/SessionElement.php index a7679fe..41ef654 100644 --- a/Models/SessionElement.php +++ b/Models/SessionElement.php @@ -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(), ]; }