From d7e0fe1c3640795ff3ebacc72454466e03f69026 Mon Sep 17 00:00:00 2001 From: Juned Chhipa Date: Tue, 10 Dec 2024 15:11:43 +0530 Subject: [PATCH] fix #3466; correct date when 1st value in x-axis is last day of month --- src/modules/TimeScale.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/TimeScale.js b/src/modules/TimeScale.js index 8c0d1c061..34217c4ef 100644 --- a/src/modules/TimeScale.js +++ b/src/modules/TimeScale.js @@ -545,6 +545,10 @@ class TimeScale { val = firstTickValue // in case it's the last date of month, we need to check it month = changeMonth(date, currentMonth, currentYear) + + if (val !== 1) { + unit = 'day' + } } // push the first tick in the array @@ -635,7 +639,7 @@ class TimeScale { hour = 0 date += 1 unit = 'day' - // Unit changed to day , Value should align unit + // Unit changed to day , Value should align unit firstTickValue = date }