Skip to content

Commit

Permalink
[#2027] Fix date range bug (#2034)
Browse files Browse the repository at this point in the history
Currently, users are unable to select a zoom range that includes 
the until date.

This results in misleading data being presented to users.
  • Loading branch information
jq1836 committed Sep 24, 2023
1 parent 3bad16b commit 075d34d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/components/c-summary-charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ export default defineComponent({
// skip if accidentally clicked on ramp chart
if (this.drags.length === 2 && this.drags[1] - this.drags[0]) {
const tdiff = (new Date(this.filterUntilDate)).valueOf() - (new Date(this.filterSinceDate)).valueOf();
// additional day was added to include the date represented by filterUntilDate
const tdiff = (new Date(this.filterUntilDate)).valueOf() - (new Date(this.filterSinceDate)).valueOf()
+ window.DAY_IN_MS;
const idxs = this.drags.map((x) => (x * tdiff) / 100);
const tsince = window.getDateStr(new Date(this.filterSinceDate).getTime() + idxs[0]);
const tuntil = window.getDateStr(new Date(this.filterSinceDate).getTime() + idxs[1]);
Expand Down

0 comments on commit 075d34d

Please sign in to comment.