mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Standard
This commit is contained in:
parent
8a8b7bd48c
commit
a99b31a61d
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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')
|
||||
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user