diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index 06d7a4ca6e..c1288da6ef 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -186,6 +186,11 @@ export class Et2Date extends Et2InputWidget(LionInputDatepicker) getValue() { + if(this.readOnly) + { + return null; + } + // The supplied value was not understandable, return null if(this.modelValue instanceof Unparseable || !this.modelValue) { @@ -236,12 +241,35 @@ export class Et2Date extends Et2InputWidget(LionInputDatepicker) return new Date(modelValue.getTime() + offset); } + /** + * Overriding from parent for read-only + * + * @return {TemplateResult} + * @protected + */ + // eslint-disable-next-line class-methods-use-this + _inputGroupInputTemplate() + { + if(this.readOnly) + { + return this.formattedValue; + } + else + { + return super._inputGroupInputTemplate(); + } + } + /** * Overriding parent to add class to button, and use an image instead of unicode emoji */ // eslint-disable-next-line class-methods-use-this _invokerTemplate() { + if(this.readOnly) + { + return ''; + } let img = this.egw() ? this.egw().image("calendar") || '' : ''; return html`