jsgantt-improved
Advanced tools
Comparing version 2.5.7 to 2.5.8
@@ -295,3 +295,3 @@ "use strict"; | ||
if (_this[column] == 1 || column === 'vAdditionalHeaders') { | ||
draw_columns_1.draw_header(column, i_1, vTmpRow_1, _this.vTaskList, _this.vEditable, _this.vEventsChange, _this.vEvents, _this.vDateTaskTableDisplayFormat, _this.vAdditionalHeaders, _this.vFormat, _this.vLangs, _this.vLang, _this.vResources, _this.Draw); | ||
draw_columns_1.draw_header(column, i_1, vTmpRow_1, _this.vTaskList, _this.vEditable, _this.vEventsChange, _this.vEvents, _this.vDateTaskTableDisplayFormat, _this.vAdditionalHeaders, _this.vFormat, _this.vLangs, _this.vLang, _this.vResources, _this.Draw.bind(_this)); | ||
} | ||
@@ -298,0 +298,0 @@ }); |
@@ -351,3 +351,2 @@ "use strict"; | ||
}; | ||
// "pID": 122 | ||
var vColumnsNames = { | ||
@@ -354,0 +353,0 @@ taskname: 'pName', |
@@ -271,2 +271,5 @@ "use strict"; | ||
} | ||
else if (!vEnd && !vStart && vPlanStart && vPlanEnd) { | ||
return calculateVDuration(pFormat, pLang, this.getPlanStart(), this.getPlanEnd()); | ||
} | ||
else if (!vEnd && vDuration) { | ||
@@ -276,49 +279,54 @@ return vDuration; | ||
else { | ||
var vUnits = null; | ||
switch (pFormat) { | ||
case 'week': | ||
vUnits = 'day'; | ||
break; | ||
case 'month': | ||
vUnits = 'week'; | ||
break; | ||
case 'quarter': | ||
vUnits = 'month'; | ||
break; | ||
default: | ||
vUnits = pFormat; | ||
break; | ||
} | ||
// let vTaskEnd = new Date(this.getEnd().getTime()); | ||
// if ((vTaskEnd.getTime() - (vTaskEnd.getTimezoneOffset() * 60000)) % (86400000) == 0) { | ||
// vTaskEnd = new Date(vTaskEnd.getFullYear(), vTaskEnd.getMonth(), vTaskEnd.getDate() + 1, vTaskEnd.getHours(), vTaskEnd.getMinutes(), vTaskEnd.getSeconds()); | ||
// } | ||
// let tmpPer = (getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
var hours = (this.getEnd().getTime() - this.getStart().getTime()) / 1000 / 60 / 60; | ||
var tmpPer = void 0; | ||
switch (vUnits) { | ||
case 'hour': | ||
tmpPer = Math.round(hours); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['hrs'] : pLang['hr']); | ||
break; | ||
case 'day': | ||
tmpPer = Math.round(hours / 24); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['dys'] : pLang['dy']); | ||
break; | ||
case 'week': | ||
tmpPer = Math.round(hours / 24 / 7); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['wks'] : pLang['wk']); | ||
break; | ||
case 'month': | ||
tmpPer = Math.round(hours / 24 / 7 / 30); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['mths'] : pLang['mth']); | ||
break; | ||
case 'quarter': | ||
tmpPer = Math.round(hours / 24 / 7 / 30 / 3); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['qtrs'] : pLang['qtr']); | ||
break; | ||
} | ||
vDuration = calculateVDuration(pFormat, pLang, this.getStart(), this.getEnd()); | ||
} | ||
return vDuration; | ||
}; | ||
function calculateVDuration(pFormat, pLang, start, end) { | ||
var vDuration; | ||
var vUnits = null; | ||
switch (pFormat) { | ||
case 'week': | ||
vUnits = 'day'; | ||
break; | ||
case 'month': | ||
vUnits = 'week'; | ||
break; | ||
case 'quarter': | ||
vUnits = 'month'; | ||
break; | ||
default: | ||
vUnits = pFormat; | ||
break; | ||
} | ||
// let vTaskEnd = new Date(this.getEnd().getTime()); | ||
// if ((vTaskEnd.getTime() - (vTaskEnd.getTimezoneOffset() * 60000)) % (86400000) == 0) { | ||
// vTaskEnd = new Date(vTaskEnd.getFullYear(), vTaskEnd.getMonth(), vTaskEnd.getDate() + 1, vTaskEnd.getHours(), vTaskEnd.getMinutes(), vTaskEnd.getSeconds()); | ||
// } | ||
// let tmpPer = (getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
var hours = (end.getTime() - start.getTime()) / 1000 / 60 / 60; | ||
var tmpPer; | ||
switch (vUnits) { | ||
case 'hour': | ||
tmpPer = Math.round(hours); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['hrs'] : pLang['hr']); | ||
break; | ||
case 'day': | ||
tmpPer = Math.round(hours / 24); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['dys'] : pLang['dy']); | ||
break; | ||
case 'week': | ||
tmpPer = Math.round(hours / 24 / 7); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['wks'] : pLang['wk']); | ||
break; | ||
case 'month': | ||
tmpPer = Math.round(hours / 24 / 7 / 30); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['mths'] : pLang['mth']); | ||
break; | ||
case 'quarter': | ||
tmpPer = Math.round(hours / 24 / 7 / 30 / 3); | ||
vDuration = tmpPer + ' ' + ((tmpPer != 1) ? pLang['qtrs'] : pLang['qtr']); | ||
break; | ||
} | ||
return vDuration; | ||
} | ||
this.getBarText = function () { return vBarText; }; | ||
@@ -325,0 +333,0 @@ this.getParent = function () { return vParent; }; |
@@ -348,3 +348,3 @@ [ | ||
"pPlanStart": "2019-07-17", | ||
"pPlanEnd": "2019-09-15", | ||
"pPlanEnd": "2021-09-15", | ||
"pClass": "gtaskpurple", | ||
@@ -361,3 +361,20 @@ "pLink": "", | ||
"pNotes": "" | ||
}, | ||
{ | ||
"pID": 36, | ||
"pName": "Just dates", | ||
"pStart": "2019-07-17", | ||
"pEnd": "2021-09-15", | ||
"pClass": "gtaskpurple", | ||
"pLink": "", | ||
"pMile": 0, | ||
"pRes": "Mario", | ||
"pComp": 0, | ||
"pGroup": 0, | ||
"pParent": 3, | ||
"pOpen": 1, | ||
"pDepend": "333", | ||
"pCaption": "", | ||
"pNotes": "" | ||
} | ||
] |
{ | ||
"name": "jsgantt-improved", | ||
"version": "2.5.7", | ||
"version": "2.5.8", | ||
"description": "jsgantt-improved", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4817147
112909