Skip to content

Commit

Permalink
fix bug with avgPerDay when user pick more then 90 days
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeryPilinoga committed Jul 7, 2019
1 parent d5996a6 commit 0e55c06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ function avgPerDay(time) {
var toDate = $('#reportrange').data('daterangepicker').endDate._d;
var timeDiff = Math.abs(toDate.getTime() - fromDate.getTime());
var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
if (diffDays > 90) {
diffDays = 90;
}
var avgPerDay = time / diffDays;
return 'Average time per day: ' + timeFormatter(Math.ceil(avgPerDay));
}
Expand Down

0 comments on commit 0e55c06

Please sign in to comment.