Skip to content

Commit

Permalink
fix: made daterange selector date-inclusive/include the day of the en…
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Mar 25, 2023
1 parent 110bf64 commit 839366e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/InputTimeInterval.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
div
div
b-alert(v-if="mode == 'range' && invalidDaterange", variant="warning", show)
| The selected date range is invalid. The second date must be greater than the first date.
| The selected date range is invalid. The second date must be greater or equal to the first date.
b-alert(v-if="mode == 'range' && daterangeTooLong", variant="warning", show)
| The selected date range is too long. The maximum is {{ maxDuration/(24*60*60) }} days.

Expand Down Expand Up @@ -83,7 +83,7 @@ export default {
value: {
get() {
if (this.mode == 'range' && this.start && this.end) {
return [moment(this.start), moment(this.end)];
return [moment(this.start), moment(this.end).add(1, 'day')];
} else {
return [moment().subtract(this.duration, 'seconds'), moment()];
}
Expand All @@ -93,7 +93,7 @@ export default {
return !(this.start && this.end);
},
invalidDaterange() {
return moment(this.start) >= moment(this.end);
return moment(this.start) > moment(this.end);
},
daterangeTooLong() {
return moment(this.start).add(this.maxDuration, 'seconds').isBefore(moment(this.end));
Expand Down

1 comment on commit 839366e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.1 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.1 (click to expand)

Please sign in to comment.