mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Complexity
This commit is contained in:
@@ -74,17 +74,20 @@ const isInvalidDate = function (date, dateFormat, excludes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fixTaskDates = function (task, dateFormat, excludes) {
|
const fixTaskDates = function (task, dateFormat, excludes) {
|
||||||
if (excludes.length && !task.manualEndTime) {
|
if (! excludes.length || task.manualEndTime) return;
|
||||||
let startTime = moment(task.startTime).add(1, 'd')
|
|
||||||
let endTime = moment(task.endTime)
|
let startTime = moment(task.startTime)
|
||||||
while (startTime.date() <= endTime.date()) {
|
startTime.add(1, 'd')
|
||||||
if (isInvalidDate(startTime, dateFormat, excludes)) {
|
let endTime = moment(task.endTime)
|
||||||
endTime.add(1, 'd')
|
|
||||||
}
|
while (startTime.date() <= endTime.date()) {
|
||||||
startTime.add(1, 'd')
|
if (isInvalidDate(startTime, dateFormat, excludes)) {
|
||||||
|
endTime.add(1, 'd')
|
||||||
}
|
}
|
||||||
task.endTime = endTime.toDate()
|
startTime.add(1, 'd')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task.endTime = endTime.toDate()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStartDate = function (prevTime, dateFormat, str) {
|
const getStartDate = function (prevTime, dateFormat, str) {
|
||||||
|
Reference in New Issue
Block a user