From e853474cddd2f66398c83376281c5aa4ab81fb3d Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Fri, 1 Apr 2022 10:08:24 +0000 Subject: [PATCH] loghelper: Fix a bug when parsing a JSON-parsed record. In those cases the time is not Date format and needs to be parsed beforehand. package: Release new version --- api/core/loghelper.mjs | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/core/loghelper.mjs b/api/core/loghelper.mjs index 97869d4..2e18362 100644 --- a/api/core/loghelper.mjs +++ b/api/core/loghelper.mjs @@ -68,8 +68,10 @@ export function formatLog(data) { delete rec.v; + let d = new Date(rec.time) + // Time. - var time = '[' + rec.time.toISOString().replace('T', ' ').replace('Z', '') + ']' + var time = '[' + d.toISOString().replace('T', ' ').replace('Z', '') + ']' time = stylize(time, 'none') delete rec.time; diff --git a/package.json b/package.json index 102187b..ea97cc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sc-manager", - "version": "2.0.1", + "version": "2.0.2", "description": "", "main": "index.js", "scripts": {