Skip to content

Commit

Permalink
Fix blue line in daily view (#41)
Browse files Browse the repository at this point in the history
* fix drawing length

fix each drawing length so that the current date line is accurate

change the drawing procedure so that there's no 1-pixel padding before the start of each task in the gantt chart
  • Loading branch information
RickCardoso authored and eduardomourar committed Dec 18, 2017
1 parent 8ed6f69 commit 33ede68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<!-- Content -->
<!-- Home -->
<div class="container-fluid" id="home">
<div class="row">
<div class="row">
<div class="col-lg-6 text-center">
<h1 class="display-1 product-name" id="home-title">jsGanttImproved</h1>
<h2 class="display-2" id="home-subtitle">latest v1.7.5.4</h2>
Expand Down
10 changes: 5 additions & 5 deletions jsgantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ JSGantt.GanttChart=function(pDiv, pFormat)
}
else
{
vTaskWidth=vTaskRightPx-1;
vTaskWidth=vTaskRightPx;

// Draw Group Bar which has outer div with inner group div and several small divs to left and right to create angled-end indicators
if(vTaskList[i].getGroup())
Expand Down Expand Up @@ -1663,11 +1663,11 @@ JSGantt.getOffset=function(pStartDate, pEndDate, pColWidth, pFormat)

if(pFormat=='day')
{
vTaskRightPx=Math.ceil((vTaskRight/24) * (pColWidth+1));
vTaskRightPx=Math.ceil((vTaskRight/24) * (pColWidth+3) - 1);
}
else if(pFormat=='week')
{
vTaskRightPx=Math.ceil(((vTaskRight/24) * (pColWidth+1))/7);
vTaskRightPx=Math.ceil((vTaskRight/(24*7)) * (pColWidth+3) - 1);
}
else if(pFormat=='month')
{
Expand All @@ -1676,7 +1676,7 @@ JSGantt.getOffset=function(pStartDate, pEndDate, pColWidth, pFormat)
vPosTmpDate.setDate(curTaskStart.getDate());
var vDaysCrctn=(curTaskEnd.getTime()-vPosTmpDate.getTime())/ (86400000);

vTaskRightPx=Math.ceil((vMonthsDiff * (pColWidth+1))+(vDaysCrctn * (pColWidth/vMonthDaysArr[curTaskEnd.getMonth()])));
vTaskRightPx=Math.ceil((vMonthsDiff * (pColWidth+3))+(vDaysCrctn * (pColWidth/vMonthDaysArr[curTaskEnd.getMonth()])) - 1);
}
else if(pFormat=='quarter')
{
Expand All @@ -1685,7 +1685,7 @@ JSGantt.getOffset=function(pStartDate, pEndDate, pColWidth, pFormat)
vPosTmpDate.setDate(curTaskStart.getDate());
vDaysCrctn=(curTaskEnd.getTime()-vPosTmpDate.getTime())/ (86400000);

vTaskRightPx=Math.ceil((vMonthsDiff * ((pColWidth+1)/3))+(vDaysCrctn * (pColWidth/90)));
vTaskRightPx=Math.ceil((vMonthsDiff * ((pColWidth+3)/3))+(vDaysCrctn * (pColWidth/90)) - 1);
}
else if(pFormat=='hour')
{
Expand Down

0 comments on commit 33ede68

Please sign in to comment.