From 3e2b76f75b78f88bc07b75fe77a857bb5d069023 Mon Sep 17 00:00:00 2001 From: mrfry Date: Mon, 16 Nov 2020 20:23:38 +0100 Subject: [PATCH] Changed /-s to "-" in date format --- src/utils/ids.js | 4 ++-- src/utils/logger.js | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/utils/ids.js b/src/utils/ids.js index e8a253b..9b02141 100755 --- a/src/utils/ids.js +++ b/src/utils/ids.js @@ -90,9 +90,9 @@ function AddVisitStat(name, subj, newQuestions, allQuestions) { var date = new Date() const now = date.getFullYear() + - '/' + + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + - '/' + + '-' + ('0' + date.getDate()).slice(-2) if (vData[now] === undefined) { vData[now] = {} diff --git a/src/utils/logger.js b/src/utils/logger.js index d87aa76..3f0b6b2 100755 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -47,7 +47,7 @@ const uvStatsFile = 'stats/uvstats' const nologFile = './nolog' const colors = ['green', 'red', 'yellow', 'blue', 'magenta', 'cyan'] -var logFileName = getDayString() +var logFileName = utils.GetDateString(true) const writeInterval = 10 const debugLevel = parseInt(process.env.NS_LOGLEVEL) || 0 @@ -61,18 +61,7 @@ let writes = 0 let noLogips = [] function setNewLogfileName() { - logFileName = getDayString() -} - -function getDayString() { - const date = new Date() - return ( - date.getFullYear() + - '_' + - ('0' + (date.getMonth() + 1)).slice(-2) + - '_' + - ('0' + date.getDate()).slice(-2) - ) + logFileName = utils.GetDateString(true) } function GetDateString() {