From 5465cfb444612ec87b33e40bdfdc7638e70b9c73 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Wed, 12 Oct 2022 14:48:49 +1100
Subject: 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
---
 src/App.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/App.vue')

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];
-- 
cgit v1.2.3

