If there is a change in the day, then we take some actions, otherwise, we dont.
This commit is contained in:
1 parent
b939cf9dc2
commit
0fd287b72d
2 files changed
+13
-3
No files matched your search
Binary file not shown.
+13
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user