diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index 89f53c18ba..2c332e247a 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -455,7 +455,7 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl }; } - set_value(value) + set value(value) { if(!value || value == 0 || value == "0") { @@ -487,13 +487,8 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl } } - getValue() + get value() { - if(this.readonly || this.disabled) - { - return null; - } - // Copied from flatpickr, since Et2InputWidget overwrote flatpickr.getValue() if(!this._inputElement) { diff --git a/api/js/etemplate/Validators/Required.ts b/api/js/etemplate/Validators/Required.ts index 8b0f95cdea..5935bf920b 100644 --- a/api/js/etemplate/Validators/Required.ts +++ b/api/js/etemplate/Validators/Required.ts @@ -2,6 +2,18 @@ import {Required as LionRequired} from "@lion/form-core"; export class Required extends LionRequired { + /** + * Returns a Boolean. True if the test fails + * @param {?} [modelValue] + * @param {?} [param] + * @param {{}} [config] + * @returns {Boolean|Promise} + */ + execute(modelValue : any, param : any, config : {}) : boolean | Promise + { + return modelValue == "" || modelValue == undefined || modelValue == null; + } + /** * Give a message about this field being required. Could be customised according to MessageData. * @param {MessageData | undefined} data