From 347d0a0dc73db8a0b2249810f5f2fe7ef5033755 Mon Sep 17 00:00:00 2001 From: tecc Date: Thu, 9 Mar 2023 19:35:07 +0100 Subject: [PATCH] fix(timesheets): Make the ranges always the end of the months using Luxon's `endOf` function --- routes/adminTimesheetsOverview.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/adminTimesheetsOverview.vue b/routes/adminTimesheetsOverview.vue index a065fb266..d667f4f5c 100644 --- a/routes/adminTimesheetsOverview.vue +++ b/routes/adminTimesheetsOverview.vue @@ -101,7 +101,9 @@ export default { }, isInRange(year, month) { const x = DateTime.local(year, month, 15); - return x >= DateTime.local(this.startYear, this.startMonth, 1) && x <= DateTime.local(this.endYear, this.endMonth, 30); + const begin = DateTime.local(this.startYear, this.startMonth, 1).startOf('month'); + const end = DateTime.local(this.endYear, this.endMonth, 1).endOf('month'); + return x.ts >= begin.ts && x.ts <= end.ts; } }, computed: {