Skip to content

Commit

Permalink
Fix calculate start date of tasks (#17)
Browse files Browse the repository at this point in the history
* Fix calculate start date of tasks
* Remove breakpoints
* Add changelog, up version to 1.0.1
  • Loading branch information
MrMeison authored and ignatvilesov committed Jun 8, 2017
1 parent e33c68c commit f47a531
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 1.0.1
* Fixed start date calculation
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-gantt",
"version": "0.5.2",
"version": "1.0.1",
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pbiviz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Gantt",
"guid": "Gantt1448688115699",
"visualClassName": "Gantt",
"version": "0.5.2",
"version": "1.0.1",
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
"supportUrl": "http://community.powerbi.com",
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-gantt"
Expand Down
2 changes: 1 addition & 1 deletion src/gantt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ module powerbi.extensibility.visual {
if (tasks.length < Gantt.MinTasks) {
return;
}
let startDate: Date = tasks[0].start;
let startDate: Date = _.minBy(tasks, (t) => t.start).start;
let endDate: Date = _.maxBy(tasks, (t) => t.end).end;
let dateTypeMilliseconds: number = Gantt.getDateType(this.viewModel.settings.dateType.type);
let ticks: number = Math.ceil(Math.round(endDate.valueOf() - startDate.valueOf()) / dateTypeMilliseconds);
Expand Down

0 comments on commit f47a531

Please sign in to comment.