mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
Merge branch 'develop' into feat/usecase-diagram-implementation
This commit is contained in:
5
.changeset/moody-fans-try.md
Normal file
5
.changeset/moody-fans-try.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'mermaid': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: Resolve gantt chart crash due to invalid array length
|
2
.github/workflows/e2e-timings.yml
vendored
2
.github/workflows/e2e-timings.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
|||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Commit and create pull request
|
- name: Commit and create pull request
|
||||||
uses: peter-evans/create-pull-request@18e469570b1cf0dfc11d60ec121099f8ff3e617a
|
uses: peter-evans/create-pull-request@915d841dae6a4f191bb78faf61a257411d7be4d2
|
||||||
with:
|
with:
|
||||||
add-paths: |
|
add-paths: |
|
||||||
cypress/timings.json
|
cypress/timings.json
|
||||||
|
@@ -803,4 +803,34 @@ describe('Gantt diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('should handle numeric timestamps with dateFormat x', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title Process time profile (ms)
|
||||||
|
dateFormat x
|
||||||
|
axisFormat %L
|
||||||
|
tickInterval 250millisecond
|
||||||
|
|
||||||
|
section Pipeline
|
||||||
|
Parse JSON p1: 000, 120
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should handle numeric timestamps with dateFormat X', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gantt
|
||||||
|
title Process time profile (ms)
|
||||||
|
dateFormat X
|
||||||
|
axisFormat %L
|
||||||
|
tickInterval 250millisecond
|
||||||
|
|
||||||
|
section Pipeline
|
||||||
|
Parse JSON p1: 000, 120
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -268,7 +268,9 @@ const fixTaskDates = function (startTime, endTime, dateFormat, excludes, include
|
|||||||
|
|
||||||
const getStartDate = function (prevTime, dateFormat, str) {
|
const getStartDate = function (prevTime, dateFormat, str) {
|
||||||
str = str.trim();
|
str = str.trim();
|
||||||
|
if ((dateFormat.trim() === 'x' || dateFormat.trim() === 'X') && /^\d+$/.test(str)) {
|
||||||
|
return new Date(Number(str));
|
||||||
|
}
|
||||||
// Test for after
|
// Test for after
|
||||||
const afterRePattern = /^after\s+(?<ids>[\d\w- ]+)/;
|
const afterRePattern = /^after\s+(?<ids>[\d\w- ]+)/;
|
||||||
const afterStatement = afterRePattern.exec(str);
|
const afterStatement = afterRePattern.exec(str);
|
||||||
|
Reference in New Issue
Block a user