From b115ad3cd77679e3cf14323ec5771f74d681759f Mon Sep 17 00:00:00 2001 From: omkarht Date: Thu, 27 Nov 2025 21:54:04 +0530 Subject: [PATCH] fix: remove fallback to new Date() for non-timestamp formats in date validation on-behalf-of: @Mermaid-Chart --- packages/mermaid/src/diagrams/gantt/ganttDb.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.js b/packages/mermaid/src/diagrams/gantt/ganttDb.js index 185fdae41..7faf357f2 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.js +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.js @@ -309,12 +309,6 @@ const getStartDate = function (prevTime, dateFormat, str) { log.debug('Invalid date:' + str); log.debug('With date format:' + dateFormat.trim()); - // Only allow fallback to new Date() for timestamp formats (x, X) - // For all other formats, if dayjs strict parsing fails, throw an error - if (!isTimestampFormat(dateFormat)) { - log.debug(`Invalid date: "${str}" does not match format "${dateFormat.trim()}".`); - } - // Timestamp formats can fall back to new Date() const d = new Date(str); if (