Api: Fix custom date & datetime fields with data format set caused a JS error

TypeError: Cannot set property format of #<Et2DateTime> which has only a getter
This commit is contained in:
nathan 2023-09-13 09:08:00 -06:00
parent a35e80c73a
commit 0f77eca5c4

View File

@ -634,11 +634,19 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
_setup_date(field_name, field, attrs) {
attrs.data_format = field.values && field.values.format ? field.values.format : 'Y-m-d';
if(field.values?.format)
{
delete field.values.format;
}
return true;
}
_setup_date_time( field_name, field, attrs)
{
attrs.data_format = field.values && field.values.format ? field.values.format : 'Y-m-d H:i:s';
if(field.values?.format)
{
delete field.values.format;
}
return true;
}
_setup_htmlarea( field_name, field, attrs)