diff --git a/api/js/etemplate/Et2Date/Et2DateDuration.ts b/api/js/etemplate/Et2Date/Et2DateDuration.ts index 673524f3f1..24aa40937c 100644 --- a/api/js/etemplate/Et2Date/Et2DateDuration.ts +++ b/api/js/etemplate/Et2Date/Et2DateDuration.ts @@ -534,14 +534,16 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement) { let inputs = []; let value = typeof this._display.value === "number" ? this._display.value : (this._display.value.split(":") || []); - for(let i = this.selectUnit ? 1 : this.displayFormat.length; i > 0; --i) + let count = this.selectUnit ? 1 : this.displayFormat.length; + for(let i = count; i > 0; --i) { let input = { name: "", title: "", value: typeof value == "number" ? value : ((this.selectUnit ? value.pop() : value[i]) || ""), min: undefined, - max: undefined + max: undefined, + precision: count == 1 ? 2 : 0 }; if(!this.selectUnit) { @@ -575,7 +577,7 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement) ` )} `;