cloud-ide-element 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -648,6 +648,16 @@ class CideInputComponent {
|
|
|
648
648
|
if (dateRegex.test(value) && !isNaN(Date.parse(value))) {
|
|
649
649
|
return value; // Already in correct format
|
|
650
650
|
}
|
|
651
|
+
else {
|
|
652
|
+
// Try to parse and format unformatted date to YYYY-MM-DD
|
|
653
|
+
const parsedDate = new Date(value);
|
|
654
|
+
if (!isNaN(parsedDate.getTime())) {
|
|
655
|
+
const year = parsedDate.getFullYear();
|
|
656
|
+
const month = String(parsedDate.getMonth() + 1).padStart(2, '0');
|
|
657
|
+
const day = String(parsedDate.getDate()).padStart(2, '0');
|
|
658
|
+
return `${year}-${month}-${day}`;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
651
661
|
}
|
|
652
662
|
else if (type === 'url' && typeof value === 'string' && value) {
|
|
653
663
|
// Normalize URL format - ensure it starts with http:// or https://
|