|
1 | 1 | /*
|
2 |
| - _ ___ _____ _ _____ ____ _ |
3 |
| - (_) / _ \ \_ \ / ||___ | ___| / | |
4 |
| - | |/ /_\/ / /\/ | | / /|___ \ | | |
5 |
| - | / /_\\/\/ /_ | |_ / /_ ___) || | |
6 |
| - _/ \____/\____/ |_(_)_/(_)____(_)_| |
| 2 | + _ ___ _____ _ _____ ____ ____ |
| 3 | + (_) / _ \ \_ \ / ||___ | ___| |___ \ |
| 4 | + | |/ /_\/ / /\/ | | / /|___ \ __) | |
| 5 | + | / /_\\/\/ /_ | |_ / /_ ___) | / __/ |
| 6 | + _/ \____/\____/ |_(_)_/(_)____(_)_____| |
7 | 7 | |__/
|
8 |
| - jsGanttImproved 1.7.5.1 |
| 8 | + jsGanttImproved 1.7.5.2 |
9 | 9 | Copyright (c) 2013-2016, Paul Geldart All rights reserved.
|
10 | 10 |
|
11 | 11 | The current version of this code can be found at https://code.google.com/p/jsgantt-improved/
|
@@ -85,6 +85,8 @@ JSGantt.TaskItem=function(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes,
|
85 | 85 | var vName=document.createTextNode(pName).data;
|
86 | 86 | var vStart=new Date(0);
|
87 | 87 | var vEnd=new Date(0);
|
| 88 | + var vGroupMinStart=null; |
| 89 | + var vGroupMinEnd=null; |
88 | 90 | var vClass=document.createTextNode(pClass).data;
|
89 | 91 | var vLink=document.createTextNode(pLink).data;
|
90 | 92 | var vMile=parseInt(document.createTextNode(pMile).data);
|
@@ -121,10 +123,16 @@ JSGantt.TaskItem=function(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes,
|
121 | 123 | JSGantt.stripUnwanted(vNotes);
|
122 | 124 | }
|
123 | 125 |
|
124 |
| - if (vGroup!=1) |
| 126 | + if (pStart!=null && pStart!='') |
125 | 127 | {
|
126 | 128 | vStart=(pStart instanceof Date)?pStart:JSGantt.parseDateStr(document.createTextNode(pStart).data,vGantt.getDateInputFormat());
|
| 129 | + vGroupMinStart=vStart; |
| 130 | + } |
| 131 | + |
| 132 | + if (pEnd!=null && pEnd!='') |
| 133 | + { |
127 | 134 | vEnd =(pEnd instanceof Date)?pEnd:JSGantt.parseDateStr(document.createTextNode(pEnd).data,vGantt.getDateInputFormat());
|
| 135 | + vGroupMinEnd=vEnd; |
128 | 136 | }
|
129 | 137 |
|
130 | 138 | if (pDepend!=null)
|
@@ -167,6 +175,8 @@ JSGantt.TaskItem=function(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes,
|
167 | 175 | this.getName=function(){return vName;};
|
168 | 176 | this.getStart=function(){return vStart;};
|
169 | 177 | this.getEnd=function(){return vEnd;};
|
| 178 | + this.getGroupMinStart=function(){return vGroupMinStart;}; |
| 179 | + this.getGroupMinEnd=function(){return vGroupMinEnd;}; |
170 | 180 | this.getClass=function(){return vClass;};
|
171 | 181 | this.getLink=function(){return vLink;};
|
172 | 182 | this.getMile=function(){return vMile;};
|
@@ -235,6 +245,8 @@ JSGantt.TaskItem=function(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes,
|
235 | 245 | this.getGroupSpan=function(){return vGroupSpan;};
|
236 | 246 | this.setStart=function(pStart){if(pStart instanceof Date)vStart=pStart;};
|
237 | 247 | this.setEnd=function(pEnd){if(pEnd instanceof Date)vEnd=pEnd;};
|
| 248 | + this.setGroupMinStart=function(pStart){if(pStart instanceof Date)vGroupMinStart=pStart;}; |
| 249 | + this.setGroupMinEnd=function(pEnd){if(pEnd instanceof Date)vGroupMinEnd=pEnd;}; |
238 | 250 | this.setLevel=function(pLevel){vLevel=parseInt(document.createTextNode(pLevel).data);};
|
239 | 251 | this.setNumKid=function(pNumKid){vNumKid=parseInt(document.createTextNode(pNumKid).data);};
|
240 | 252 | this.setCompVal=function(pCompVal){vComp=parseFloat(document.createTextNode(pCompVal).data);};
|
@@ -1755,6 +1767,15 @@ JSGantt.processRows=function(pList, pID, pRow, pLevel, pOpen, pUseSort)
|
1755 | 1767 |
|
1756 | 1768 | if(pRow>=0)
|
1757 | 1769 | {
|
| 1770 | + if(pList[pRow].getGroupMinStart()!=null && pList[pRow].getGroupMinStart()<vMinDate) |
| 1771 | + { |
| 1772 | + vMinDate=pList[pRow].getGroupMinStart(); |
| 1773 | + } |
| 1774 | + |
| 1775 | + if(pList[pRow].getGroupMinEnd()!=null && pList[pRow].getGroupMinEnd()>vMaxDate) |
| 1776 | + { |
| 1777 | + vMaxDate=pList[pRow].getGroupMinEnd(); |
| 1778 | + } |
1758 | 1779 | pList[pRow].setStart(vMinDate);
|
1759 | 1780 | pList[pRow].setEnd(vMaxDate);
|
1760 | 1781 | pList[pRow].setNumKid(vNumKid);
|
|
0 commit comments