Skip to content

Commit 839366e

Browse files
committed
fix: made daterange selector date-inclusive/include the day of the end date (fixes ActivityWatch/activitywatch#693)
1 parent 110bf64 commit 839366e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/InputTimeInterval.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
div
33
div
44
b-alert(v-if="mode == 'range' && invalidDaterange", variant="warning", show)
5-
| The selected date range is invalid. The second date must be greater than the first date.
5+
| The selected date range is invalid. The second date must be greater or equal to the first date.
66
b-alert(v-if="mode == 'range' && daterangeTooLong", variant="warning", show)
77
| The selected date range is too long. The maximum is {{ maxDuration/(24*60*60) }} days.
88

@@ -83,7 +83,7 @@ export default {
8383
value: {
8484
get() {
8585
if (this.mode == 'range' && this.start && this.end) {
86-
return [moment(this.start), moment(this.end)];
86+
return [moment(this.start), moment(this.end).add(1, 'day')];
8787
} else {
8888
return [moment().subtract(this.duration, 'seconds'), moment()];
8989
}
@@ -93,7 +93,7 @@ export default {
9393
return !(this.start && this.end);
9494
},
9595
invalidDaterange() {
96-
return moment(this.start) >= moment(this.end);
96+
return moment(this.start) > moment(this.end);
9797
},
9898
daterangeTooLong() {
9999
return moment(this.start).add(this.maxDuration, 'seconds').isBefore(moment(this.end));

0 commit comments

Comments
 (0)