From e16b4e3380ad2e59dc6fff0470a2c02461bf0179 Mon Sep 17 00:00:00 2001 From: Alejandro De Maria Antolinos <demariaa@esrf.fr> Date: Mon, 9 Mar 2020 11:45:52 +0100 Subject: [PATCH] It fixes icat/icat-plus#95 --- app/controllers/logbook.controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/logbook.controller.js b/app/controllers/logbook.controller.js index dac81d0d..dbed56f5 100644 --- a/app/controllers/logbook.controller.js +++ b/app/controllers/logbook.controller.js @@ -99,7 +99,10 @@ function saveEvent(event){ event.category = event.category.toLowerCase(); event.type = event.type.toLowerCase(); if (!event.creationDate){ - event.creationDate = new Date(); + event.creationDate = moment().toDate(); + } + else{ + event.creationDate = moment(event.creationDate).toDate(); } } catch(e){ -- GitLab