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
5bfddcc444
commit
58df72984f
@ -74,19 +74,16 @@ const isInvalidDate = function (date, dateFormat, excludes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fixTaskDates = function (task, dateFormat, excludes) {
|
const fixTaskDates = function (task, dateFormat, excludes) {
|
||||||
if (! excludes.length || task.manualEndTime) return;
|
if (!excludes.length || task.manualEndTime) return
|
||||||
|
|
||||||
let startTime = moment(task.startTime)
|
let startTime = moment(task.startTime)
|
||||||
startTime.add(1, 'd')
|
startTime.add(1, 'd')
|
||||||
let endTime = moment(task.endTime)
|
let endTime = moment(task.endTime)
|
||||||
|
|
||||||
while (startTime.date() <= endTime.date()) {
|
while (startTime.date() <= endTime.date()) {
|
||||||
if (isInvalidDate(startTime, dateFormat, excludes)) {
|
if (isInvalidDate(startTime, dateFormat, excludes)) {
|
||||||
endTime.add(1, 'd')
|
endTime.add(1, 'd')
|
||||||
}
|
}
|
||||||
startTime.add(1, 'd')
|
startTime.add(1, 'd')
|
||||||
}
|
}
|
||||||
|
|
||||||
task.endTime = endTime.toDate()
|
task.endTime = endTime.toDate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user