From b8777013d455f611a2ea600bb574356339f1f6b4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 3 Nov 2018 17:34:18 +0100 Subject: [PATCH] [fix] convert string into date object for frontend --- run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index 3818f31..3c28f67 100644 --- a/run.py +++ b/run.py @@ -507,9 +507,9 @@ async def ws_apps(request, websocket): "job_name": x.job_name, "job_state": x.job_state, "log": x.log, - "created_time": x.created_time, - "started_time": x.started_time, - "end_time": x.end_time, + "created_time": datetime.strptime(x.created_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.created_time else None, + "started_time": datetime.strptime(x.started_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.started_time else None, + "end_time": datetime.strptime(x.end_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.end_time else None, } for x in repos ]