This commit is contained in:
João Paulo Poffo 2019-02-07 11:22:46 -02:00
parent 8a8b7bd48c
commit a99b31a61d
2 changed files with 4 additions and 5 deletions

View File

@ -74,7 +74,7 @@ const isInvalidDate = function (date, dateFormat, excludes) {
}
const fixTaskDates = function (task, dateFormat, excludes) {
if (excludes.length && ! task.manualEndTime) {
if (excludes.length && !task.manualEndTime) {
let startTime = moment(task.startTime).add(1, 'd')
let endTime = moment(task.endTime)
while (startTime.date() <= endTime.date()) {
@ -233,7 +233,7 @@ const compileData = function (prevTask, dataStr) {
if (endTimeData) {
task.endTime = getEndDate(task.startTime, dateFormat, endTimeData)
task.manualEndTime = endTimeData == moment(task.endTime).format(dateFormat.trim())
task.manualEndTime = endTimeData === moment(task.endTime).format(dateFormat.trim())
fixTaskDates(task, dateFormat, excludes)
}
@ -371,8 +371,8 @@ const compileTasks = function () {
rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data)
if (rawTasks[pos].endTime) {
rawTasks[pos].processed = true
rawTasks[pos].manualEndTime = rawTasks[pos].raw.endTime.data == moment(rawTasks[pos].endTime).format(dateFormat.trim());
fixTaskDates(rawTasks[pos], dateFormat, excludes);
rawTasks[pos].manualEndTime = rawTasks[pos].raw.endTime.data === moment(rawTasks[pos].endTime).format(dateFormat.trim())
fixTaskDates(rawTasks[pos], dateFormat, excludes)
}
}

View File

@ -208,6 +208,5 @@ describe('when using the ganttDb', function () {
expect(tasks[4].endTime).toEqual(moment('2019-02-21', 'YYYY-MM-DD').toDate())
expect(tasks[4].id).toEqual('id5')
expect(tasks[4].task).toEqual('test5')
})
})