Skip to content

Commit

Permalink
fix: fix item position error when item start less than gantt start
Browse files Browse the repository at this point in the history
  • Loading branch information
HandsomeButterball committed Oct 29, 2020
1 parent b7e0cb4 commit 5295f20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/gantt/src/gantt.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.gantt-side {
border-right: 1px solid $gantt-border-color;
position: relative;
z-index: 2;
z-index: 3;
overflow-x: scroll;
box-shadow: $gantt-side-shadow;

Expand Down
3 changes: 2 additions & 1 deletion packages/gantt/src/views/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ export abstract class GanttView {
protected getDateIntervalWidth(start: GanttDate, end: GanttDate) {
let result = 0;
const days = differenceInDays(end.value, start.value);
for (let i = 0; i < days; i++) {
for (let i = 0; i < Math.abs(days); i++) {
result += this.getDayOccupancyWidth(start.addDays(i));
}
result = days >= 0 ? result : -result;
return Number(result.toFixed(3));
}

Expand Down

0 comments on commit 5295f20

Please sign in to comment.