aboutsummaryrefslogtreecommitdiff
path: root/src/App.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-12 14:48:49 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-12 14:48:49 +1100
commit5465cfb444612ec87b33e40bdfdc7638e70b9c73 (patch)
tree9ebea79e40615659c529fe75eba33468c0893227 /src/App.vue
parent314c1c95f77d6e4be559df3a58278f6c37f61e5c (diff)
Convert to represent dates instead of numbers
- Add HistDate class - Adapt TimeLine and BaseLine to work with HistDates - For own-size-watching components, add onMounted() hook to run before ResizeObserver is set up
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue
index f32b367..278ef63 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -38,7 +38,7 @@ import PlusIcon from './components/icon/PlusIcon.vue';
import SettingsIcon from './components/icon/SettingsIcon.vue';
import HelpIcon from './components/icon/HelpIcon.vue';
// Other
-import {TimelineRange} from './lib';
+import {HistDate, TimelineRange} from './lib';
import {useStore} from './store';
// Refs
@@ -62,11 +62,11 @@ onMounted(updateAreaDims)
const timelineRanges: Ref<TimelineRange[]> = ref([]);
let nextTimelineId = 1;
function addNewTimelineRange(){
- timelineRanges.value.push({id: nextTimelineId, start: -500, end: 500});
+ timelineRanges.value.push({id: nextTimelineId, start: new HistDate(1900, 1, 1), end: new HistDate(2000, 1, 1)});
nextTimelineId++;
}
addNewTimelineRange();
-function onRangeChg(newBounds: [number, number], idx: number){
+function onRangeChg(newBounds: [HistDate, HistDate], idx: number){
let range = timelineRanges.value[idx];
range.start = newBounds[0];
range.end = newBounds[1];