From 0f77eca5c474fc748ade589fbc6cfe67a98cbae6 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 13 Sep 2023 09:08:00 -0600 Subject: [PATCH] Api: Fix custom date & datetime fields with data format set caused a JS error TypeError: Cannot set property format of # which has only a getter --- api/js/etemplate/et2_extension_customfields.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/js/etemplate/et2_extension_customfields.ts b/api/js/etemplate/et2_extension_customfields.ts index bcb1cc4bb1..58e4b467ae 100644 --- a/api/js/etemplate/et2_extension_customfields.ts +++ b/api/js/etemplate/et2_extension_customfields.ts @@ -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)