diff --git a/api/js/etemplate/Et2Date/Et2DateDuration.ts b/api/js/etemplate/Et2Date/Et2DateDuration.ts index 6cd0676510..459a8d3153 100644 --- a/api/js/etemplate/Et2Date/Et2DateDuration.ts +++ b/api/js/etemplate/Et2Date/Et2DateDuration.ts @@ -352,6 +352,12 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement) set displayFormat(value : string) { this.__displayFormat = ""; + if(!value) + { + // Don't allow an empty value, but don't throw a real error + console.warn("Invalid displayFormat ", value, this); + value = "dhm"; + } // Display format must be in decreasing size order (dhms) or the calculations // don't work out nicely for(let f of Object.keys(Et2DateDuration.time_formats))