Skip to content

Commit

Permalink
Fixed start date for Burndown chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom32i committed Jun 16, 2017
1 parent efe6f6e commit cd6c57e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/GitHub/Milestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Milestone {
}

get startAt() {
return this.previous ? this.previous.dueOn : this.createdAt;
return this.previous ? DateUtil.day(this.previous.dueOn, 1) : this.createdAt;
}

get days() {
Expand Down
4 changes: 3 additions & 1 deletion src/Util/DateUtil.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class DateUtil {
static day(value = new Date()) {
static day(value = new Date(), addDays = 0) {
const date = value instanceof Date ? value : new Date(value);

date.setDate(date.getDate() + addDays);

return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
}
}
Expand Down

0 comments on commit cd6c57e

Please sign in to comment.