Skip to content

Commit 33ede68

Browse files
RickCardosoeduardomourar
authored andcommitted
Fix blue line in daily view (jsGanttImproved#41)
* 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
1 parent 8ed6f69 commit 33ede68

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<!-- Content -->
7373
<!-- Home -->
7474
<div class="container-fluid" id="home">
75-
<div class="row">
75+
<div class="row">
7676
<div class="col-lg-6 text-center">
7777
<h1 class="display-1 product-name" id="home-title">jsGanttImproved</h1>
7878
<h2 class="display-2" id="home-subtitle">latest v1.7.5.4</h2>

jsgantt.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ JSGantt.GanttChart=function(pDiv, pFormat)
10861086
}
10871087
else
10881088
{
1089-
vTaskWidth=vTaskRightPx-1;
1089+
vTaskWidth=vTaskRightPx;
10901090

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

16641664
if(pFormat=='day')
16651665
{
1666-
vTaskRightPx=Math.ceil((vTaskRight/24) * (pColWidth+1));
1666+
vTaskRightPx=Math.ceil((vTaskRight/24) * (pColWidth+3) - 1);
16671667
}
16681668
else if(pFormat=='week')
16691669
{
1670-
vTaskRightPx=Math.ceil(((vTaskRight/24) * (pColWidth+1))/7);
1670+
vTaskRightPx=Math.ceil((vTaskRight/(24*7)) * (pColWidth+3) - 1);
16711671
}
16721672
else if(pFormat=='month')
16731673
{
@@ -1676,7 +1676,7 @@ JSGantt.getOffset=function(pStartDate, pEndDate, pColWidth, pFormat)
16761676
vPosTmpDate.setDate(curTaskStart.getDate());
16771677
var vDaysCrctn=(curTaskEnd.getTime()-vPosTmpDate.getTime())/ (86400000);
16781678

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

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

0 commit comments

Comments
 (0)