From 83366605d1bd43c245c4c110fadfd1a6fd05d3c2 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Thu, 20 Oct 2022 15:31:05 +1100
Subject: Add gcal to client-side HistDates

Add YearDate and CalDate
Restrict non-calendar HistDates to years before 4713 BC
---
 src/components/TimeLine.vue | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/components/TimeLine.vue')

diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 5aec9b2..8a6ddc4 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -63,9 +63,9 @@ import IconButton from './IconButton.vue';
 // Icons
 import MinusIcon from './icon/MinusIcon.vue';
 // Other
-import {WRITING_MODE_HORZ, MIN_DATE, MAX_DATE, MONTH_SCALE, DAY_SCALE, SCALES, MIN_CAL_DATE,
-	HistDate, stepDate, inDateScale, getScaleRatio, getUnitDiff, getDaysInMonth, moduloPositive, TimelineState,
-	HistEvent, getImagePath} from '../lib';
+import {WRITING_MODE_HORZ, MIN_DATE, MAX_DATE, MONTH_SCALE, DAY_SCALE, SCALES,
+	MIN_CAL_YEAR, HistDate, CalDate, stepDate, inDateScale, getScaleRatio, getUnitDiff, getDaysInMonth,
+	moduloPositive, TimelineState, HistEvent, getImagePath} from '../lib';
 import {useStore} from '../store';
 import {RBTree} from '../rbtree';
 
@@ -132,6 +132,7 @@ const mainlineOffset = computed(() => { // Distance mainline-area line to side o
 
 // Timeline data
 const ID = props.initialState.id as number;
+const MIN_CAL_DATE = new CalDate(MIN_CAL_YEAR, 1, 1);
 const startDate = ref(props.initialState.startDate); // Earliest date to display
 const endDate = ref(props.initialState.endDate);
 const startOffset = ref(store.defaultEndTickOffset); // Fraction of a scale unit before startDate to show
-- 
cgit v1.2.3

