diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-02 17:47:38 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-02 17:47:38 +1100 |
| commit | d48f3b862fad74af6576297d471d7834b1f0bba8 (patch) | |
| tree | 1a3ca9490711749304bb5ab59f7fcd7ed77d96e1 /src/App.vue | |
| parent | d67b35629905b6c26648c7979c28c333664f102f (diff) | |
Make baseline time-spans non-overlapping
Remove time-span labels
Fix firstDate/lastDate being passed to TimelineState instead of startDate/endDate
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); |
