aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-21 20:42:06 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-21 21:38:19 +1100
commitb17ede53cb702522ff287bc75c82caa2a9c9150e (patch)
tree0acad16e800a0856e0630eca9532170fd7662da7
parentc363088b83c9c48abcf37aff3ac59420cbcc7498 (diff)
Change initial start/end dates
-rw-r--r--src/store.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/store.ts b/src/store.ts
index 370f2b9..0b64f4d 100644
--- a/src/store.ts
+++ b/src/store.ts
@@ -4,7 +4,7 @@
import {defineStore} from 'pinia';
import {Breakpoint, getBreakpoint, onTouchDevice} from './util';
-import {HistDate, CalDate} from './lib';
+import {HistDate, CalDate, MAX_DATE} from './lib';
// ========== For store state ==========
@@ -51,8 +51,9 @@ export type StoreState = {
},
// Other
- initialStartDate: HistDate,
- initialEndDate: HistDate, // Must be later than initialStartDate
+ initialStartDate: HistDate, // Must be after MIN_DATE (from lib.ts)
+ initialEndDate: HistDate, // Must be before MAX_DATE (from lib.ts), and later than initialStartDate
+ // Currently, both dates also need to be 'at ticks on the largest scale that distinguishes them'.
color: {
text: string, // CSS color
textDark: string,
@@ -103,7 +104,7 @@ function getDefaultState(): StoreState {
tickLabelHeight: 10,
minTickSep: 30,
minLastTicks: 3,
- defaultEndTickOffset: 0.5,
+ defaultEndTickOffset: breakpoint == 'sm' ? 0.2 : 0.5,
showMinorTicks: true,
// Mainline and event display
@@ -134,8 +135,8 @@ function getDefaultState(): StoreState {
},
// Other
- initialStartDate: new CalDate(1900, 1, 1),
- initialEndDate: new CalDate(2030, 1, 1),
+ initialStartDate: new CalDate(1, 1, 1),
+ initialEndDate: new CalDate(2000, 1, 1),
color,
borderRadius: 5,
transitionDuration: 300,