From 86a7828424fcf362344d92459c171090ee959737 Mon Sep 17 00:00:00 2001 From: Cookiezaurs Date: Mon, 7 Aug 2023 16:57:49 +0300 Subject: [PATCH 1/3] [core] Fix for: When selecting single day in user analytics returning users are 0 although it should be more. --- frontend/express/public/javascripts/countly/countly.common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/express/public/javascripts/countly/countly.common.js b/frontend/express/public/javascripts/countly/countly.common.js index 9c03b434c6f..62f87c09201 100644 --- a/frontend/express/public/javascripts/countly/countly.common.js +++ b/frontend/express/public/javascripts/countly/countly.common.js @@ -3830,13 +3830,14 @@ // fromDate.tz(_appTimezone); // toDate.tz(_appTimezone); - if (fromDate.valueOf() === toDate.valueOf()) { + if (fromDate.format("YYYY.M.D") === toDate.format("YYYY.M.D")) { cycleDuration = moment.duration(1, "day"); Object.assign(periodObject, { dateString: "D MMM, HH:mm", periodMax: 23, periodMin: 0, activePeriod: fromDate.format("YYYY.M.D"), + currentPeriodArr: [fromDate.format("YYYY.M.D")], previousPeriod: fromDate.clone().subtract(1, "day").format("YYYY.M.D") }); } From 3d4363d53cc53948c3fbc218460f01711865472e Mon Sep 17 00:00:00 2001 From: Cookiezaurs Date: Mon, 7 Aug 2023 17:32:09 +0300 Subject: [PATCH 2/3] eslint --- .../express/public/javascripts/countly/countly.common.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/express/public/javascripts/countly/countly.common.js b/frontend/express/public/javascripts/countly/countly.common.js index 62f87c09201..d5fa6a0c9ca 100644 --- a/frontend/express/public/javascripts/countly/countly.common.js +++ b/frontend/express/public/javascripts/countly/countly.common.js @@ -3829,15 +3829,14 @@ endTimestamp = toDate.clone().endOf("day"); // fromDate.tz(_appTimezone); // toDate.tz(_appTimezone); - - if (fromDate.format("YYYY.M.D") === toDate.format("YYYY.M.D")) { + if (fromDate.format("YYYY.M.D") === toDate.format("YYYY.M.D")) { cycleDuration = moment.duration(1, "day"); Object.assign(periodObject, { dateString: "D MMM, HH:mm", periodMax: 23, periodMin: 0, activePeriod: fromDate.format("YYYY.M.D"), - currentPeriodArr: [fromDate.format("YYYY.M.D")], + currentPeriodArr: [fromDate.format("YYYY.M.D")], previousPeriod: fromDate.clone().subtract(1, "day").format("YYYY.M.D") }); } From 814593caeb7f955a9412cb8fe80e4dd9fd38283f Mon Sep 17 00:00:00 2001 From: Cookiezaurs Date: Mon, 7 Aug 2023 17:40:06 +0300 Subject: [PATCH 3/3] eslint --- frontend/express/public/javascripts/countly/countly.common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/express/public/javascripts/countly/countly.common.js b/frontend/express/public/javascripts/countly/countly.common.js index d5fa6a0c9ca..3b52908c9cb 100644 --- a/frontend/express/public/javascripts/countly/countly.common.js +++ b/frontend/express/public/javascripts/countly/countly.common.js @@ -3829,7 +3829,7 @@ endTimestamp = toDate.clone().endOf("day"); // fromDate.tz(_appTimezone); // toDate.tz(_appTimezone); - if (fromDate.format("YYYY.M.D") === toDate.format("YYYY.M.D")) { + if (fromDate.format("YYYY.M.D") === toDate.format("YYYY.M.D")) { cycleDuration = moment.duration(1, "day"); Object.assign(periodObject, { dateString: "D MMM, HH:mm",