diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index 2287e878..f3a5d7ac 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -248,8 +248,8 @@ limitations under the License. --> if (!day) { return appStore.setMaxRange([]); } - const gap = dayToMS(day + 1) + hour * 60 * 60 * 1000 + minute * 60 * 1000; - const dates: Date[] = [new Date(new Date().getTime() - gap), new Date()]; + const gap = Math.max(dayToMS(day), hour * 60 * 60 * 1000, minute * 60 * 1000); + const dates: Date[] = [new Date(new Date().getTime() - gap - dayToMS(1)), new Date()]; appStore.setMaxRange(dates); }