set default value

This commit is contained in:
Pete Matsyburka
2025-08-23 20:11:10 +03:00
parent 4685bac4b3
commit 719c1786f1
6 changed files with 117 additions and 37 deletions
+8 -4
View File
@@ -422,10 +422,14 @@ export default {
},
formattedDate () {
if (this.field.type === 'date' && this.modelValue) {
return this.formatDate(
this.modelValue === '{{date}}' ? new Date() : new Date(this.modelValue),
this.field.preferences?.format || (this.locale.endsWith('-US') ? 'MM/DD/YYYY' : 'DD/MM/YYYY')
)
try {
return this.formatDate(
this.modelValue === '{{date}}' ? new Date() : new Date(this.modelValue),
this.field.preferences?.format || (this.locale.endsWith('-US') ? 'MM/DD/YYYY' : 'DD/MM/YYYY')
)
} catch {
return this.modelValue
}
} else {
return ''
}