Skip to content

Commit

Permalink
[gui] Fix number of outstanding reports chart
Browse files Browse the repository at this point in the history
Let's assume that a bug was detected yesterday at 3PM and I want to view
this chart today at 1PM. In day resolution we used the current date as a
starting point and based on the interval length (e.g.: 7 days) we subtract
x days from the current date. For this reason the grap will not show me this
bug which was detected yesteday, but it assumes that is was detected today.

With this patch we will set the starting date to the end of the current date
which will solve this issue.
  • Loading branch information
csordasmarton committed Dec 10, 2021
1 parent 178ce49 commit fd5f7e0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import _ from "lodash";
import {
endOfMonth, endOfWeek, endOfYear, format, subDays, subMonths, subWeeks,
subYears
endOfMonth, endOfToday, endOfWeek, endOfYear, format, subDays, subMonths,
subWeeks, subYears
} from "date-fns";
import { Line, mixins } from "vue-chartjs";
import ChartDataLabels from "chartjs-plugin-datalabels";
Expand Down Expand Up @@ -135,7 +135,7 @@ export default {
let dateFormat = "yyyy. MMM. dd";
if (this.resolution === "days") {
const today = new Date();
const today = endOfToday();
this.dates = [ ...new Array(interval).keys() ].map(i =>
subDays(today, i));
}
Expand Down

0 comments on commit fd5f7e0

Please sign in to comment.