fix(ganttDb): change manual end time determination

now it just checks if a valid end time was provided and instead of the comparison that went on before.
This needed to be done in order to support manual end dates with inclusive set to true since they don't match anymore as the 'manually' supplied end date is increased by one
This commit is contained in:
Jason Würtz 2019-07-06 12:28:56 -03:00
parent 63096a5c26
commit ee766ec88e
1 changed files with 4 additions and 4 deletions

View File

@ -253,8 +253,8 @@ const compileData = function (prevTask, dataStr) {
}
if (endTimeData) {
task.endTime = getEndDate(task.startTime, dateFormat, endTimeData)
task.manualEndTime = endTimeData === moment(task.endTime).format(dateFormat.trim())
task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates)
task.manualEndTime = moment(endTimeData, 'YYYY-MM-DD', true).isValid()
checkTaskDates(task, dateFormat, excludes)
}
@ -392,10 +392,10 @@ const compileTasks = function () {
}
if (rawTasks[pos].startTime) {
rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data)
rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data, inclusiveEndDates)
if (rawTasks[pos].endTime) {
rawTasks[pos].processed = true
rawTasks[pos].manualEndTime = rawTasks[pos].raw.endTime.data === moment(rawTasks[pos].endTime).format(dateFormat.trim())
rawTasks[pos].manualEndTime = moment(rawTasks[pos].raw.endTime.data, 'YYYY-MM-DD', true).isValid()
checkTaskDates(rawTasks[pos], dateFormat, excludes)
}
}