forked from extern/egroupware
Et2Date: Fix required validation message was always shown after changing a required date
Some missed changes after moving from Lion
This commit is contained in:
parent
7dd0165cd2
commit
e03fea2e9b
@ -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)
|
||||
{
|
||||
|
@ -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<Boolean>}
|
||||
*/
|
||||
execute(modelValue : any, param : any, config : {}) : boolean | Promise<boolean>
|
||||
{
|
||||
return modelValue == "" || modelValue == undefined || modelValue == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Give a message about this field being required. Could be customised according to MessageData.
|
||||
* @param {MessageData | undefined} data
|
||||
|
Loading…
Reference in New Issue
Block a user