diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-03 10:07:18 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-03 10:07:18 +1100 |
| commit | 2e6463419e46ed21e8906f6519dc732398250583 (patch) | |
| tree | d91f41f83e208d1b42f97c2e9ada8257ac91de5a /src/App.vue | |
| parent | 6f34c4c3aafee39f8c7ec41a7777c194443a27fa (diff) | |
| parent | d48f3b862fad74af6576297d471d7834b1f0bba8 (diff) | |
Merge branch 'frontend-update' into backend-update
Diffstat (limited to 'src/App.vue')
| -rw-r--r-- | src/App.vue | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/App.vue b/src/App.vue index 3de3ac2..b97e55a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,7 @@ import SettingsIcon from './components/icon/SettingsIcon.vue'; import HelpIcon from './components/icon/HelpIcon.vue'; // Other import {timeout, HistDate, HistEvent, queryServer, EventResponseJson, jsonToHistEvent, - SCALES, TimelineState, cmpHistEvent, dateToUnit, DateRangeTree} from './lib'; + SCALES, stepDate, TimelineState, cmpHistEvent, dateToUnit, DateRangeTree} from './lib'; import {useStore} from './store'; import {RBTree, rbtree_shallow_copy} from './rbtree'; @@ -126,9 +126,10 @@ function reduceEvents(){ continue; } // Look for units to keep - let scaleIdx: number = timeline.scaleIdx; - let startUnit = dateToUnit(timeline.startDate, SCALES[scaleIdx]); - let endUnit = dateToUnit(timeline.endDate, SCALES[scaleIdx]); + const scaleIdx = timeline.scaleIdx; + const scale = SCALES[scaleIdx]; + let startUnit = dateToUnit(stepDate(timeline.startDate, scale, {forward: false}), scale); + let endUnit = dateToUnit(stepDate(timeline.endDate, scale), scale); for (let [unit, count] of unitCountMaps.value[scaleIdx]){ if (unit >= startUnit && unit <= endUnit){ newMaps[scaleIdx].set(unit, count); |
