Skip to content

Commit 1e78fd7

Browse files
committed
improve: make validation message fix more robust for all criteria types
1 parent 9c66a27 commit 1e78fd7

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/kendo.core.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,12 +1444,20 @@ function pad(number, digits, end) {
14441444
var parts = values[2].split(",");
14451445
if (parts.length >= 5) {
14461446
// Check if this looks like the validation message pattern
1447-
var criteriaType = parts[4]; // Should be "number", "text", "date", etc.
1447+
// Find the criteria type by looking for known validation types
1448+
var criteriaType = null;
14481449
var comparerMessage = parts[0]; // Should be the comparer message
1449-
1450-
// Only apply fix if criteriaType is a known validation type
1451-
if (criteriaType === "number" || criteriaType === "text" || criteriaType === "date" ||
1452-
criteriaType === "custom" || criteriaType === "list") {
1450+
1451+
var validationTypes = ["number", "text", "date", "custom", "list"];
1452+
for (var i = 0; i < parts.length; i++) {
1453+
if (validationTypes.indexOf(parts[i]) > -1) {
1454+
criteriaType = parts[i];
1455+
break;
1456+
}
1457+
}
1458+
1459+
// Only apply fix if we found a valid criteria type
1460+
if (criteriaType) {
14531461
values = [fmt, criteriaType, comparerMessage];
14541462
}
14551463
}

0 commit comments

Comments
 (0)