fix: remove fallback to new Date() for non-timestamp formats in date validation

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
omkarht
2025-11-27 21:54:04 +05:30
parent 73b8626ab0
commit b115ad3cd7

View File

@@ -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 (