Skip to content

Commit cd6c57e

Browse files
committed
Fixed start date for Burndown chart
1 parent efe6f6e commit cd6c57e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/GitHub/Milestone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Milestone {
8383
}
8484

8585
get startAt() {
86-
return this.previous ? this.previous.dueOn : this.createdAt;
86+
return this.previous ? DateUtil.day(this.previous.dueOn, 1) : this.createdAt;
8787
}
8888

8989
get days() {

src/Util/DateUtil.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
class DateUtil {
2-
static day(value = new Date()) {
2+
static day(value = new Date(), addDays = 0) {
33
const date = value instanceof Date ? value : new Date(value);
44

5+
date.setDate(date.getDate() + addDays);
6+
57
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
68
}
79
}

0 commit comments

Comments
 (0)