add ability to set date field format

This commit is contained in:
Pete Matsyburka
2023-12-17 23:32:05 +02:00
parent 990e4020e9
commit e558f4d9fb
9 changed files with 178 additions and 6 deletions
@@ -474,6 +474,12 @@ export default {
field.options = [{ value: '', uuid: v4() }]
}
if (type === 'date') {
field.preferences = {
format: Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') ? 'MM/DD/YYYY' : 'DD/MM/YYYY'
}
}
this.drawField = field
this.drawOption = null
},
@@ -650,6 +656,12 @@ export default {
field.options = [{ value: '', uuid: v4() }]
}
if (field.type === 'date') {
field.preferences = {
format: Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') ? 'MM/DD/YYYY' : 'DD/MM/YYYY'
}
}
const fieldArea = {
x: (area.x - 6) / area.maskW,
y: area.y / area.maskH,