From 3932d067cfca46130a82f95ac40638ebfeca5181 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sat, 15 Oct 2022 13:22:09 +1100 Subject: Prevent zooming in beyond min/max dates --- src/components/TimeLine.vue | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/components/TimeLine.vue') diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue index 8301dba..22069bc 100644 --- a/src/components/TimeLine.vue +++ b/src/components/TimeLine.vue @@ -491,6 +491,10 @@ function zoomTimeline(zoomRatio: number){ console.log('Unable to zoom into range where month/day scale is invalid'); return; } + if (newStart.isEarlier(MIN_DATE, newScale) || MAX_DATE.isEarlier(newEnd, newScale)){ + console.log('Disallowing zooming in beyond min/max dates'); + return; + } scaleIdx.value += 1; } } -- cgit v1.2.3