fix(timesheets): Make the ranges always the end of the months using Luxon's endOf function

This commit is contained in:
tecc 2023-03-09 19:35:07 +01:00
parent 6f2b085f47
commit 347d0a0dc7
No known key found for this signature in database
GPG Key ID: 400AAD881FCC028B

View File

@ -101,7 +101,9 @@ export default {
}, },
isInRange(year, month) { isInRange(year, month) {
const x = DateTime.local(year, month, 15); 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: { computed: {