diff --git a/.vs/AAOlivia-Plotter/v15/.suo b/.vs/AAOlivia-Plotter/v15/.suo index eb0b90762..0ef338d9f 100644 Binary files a/.vs/AAOlivia-Plotter/v15/.suo and b/.vs/AAOlivia-Plotter/v15/.suo differ diff --git a/Candlestick.js b/Candlestick.js index 22871a0af..27d8eabe2 100644 --- a/Candlestick.js +++ b/Candlestick.js @@ -188,11 +188,21 @@ function setDatetime(newDatetime) { - datetime = newDatetime; - recalculateCandles(); + /* If there is a change in the day, then we take some actions, otherwise, we dont. */ - fileCursorCache.setDatetime(newDatetime); + let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS); + let newDate = Math.trunc(newDatetime.valueOf() / ONE_DAY_IN_MILISECONDS); + if (currentDate !== newDate) { + + datetime = newDatetime; + recalculateCandles(); + fileCursorCache.setDatetime(newDatetime); + + } else { + + datetime = newDatetime; + } }