mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-15 04:24:57 +01:00
Et2Date: Fix timeonly does not update value the first time when manually typing a new value
This commit is contained in:
parent
ddde9ab05a
commit
2946316d0b
@ -744,8 +744,17 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(LitFlatpickr))
|
|||||||
// Avoid infinite loop of setting the same value back triggering another change
|
// Avoid infinite loop of setting the same value back triggering another change
|
||||||
this._instance.input.value !== flatpickr.formatDate(parsedDate, this.getOptions().dateFormat))
|
this._instance.input.value !== flatpickr.formatDate(parsedDate, this.getOptions().dateFormat))
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Can error for time-only due to missing calendar
|
||||||
this._instance.setDate(value, true, this._instance.config.altFormat)
|
this._instance.setDate(value, true, this._instance.config.altFormat)
|
||||||
}
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
// Just do it again, it works the second time
|
||||||
|
this._instance.setDate(value, true, this._instance.config.altFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Update the et2-textbox so it has current value for any (required) validation
|
// Update the et2-textbox so it has current value for any (required) validation
|
||||||
this._inputNode.value = formattedDate;
|
this._inputNode.value = formattedDate;
|
||||||
(<Et2Textbox>this._inputNode).validate();
|
(<Et2Textbox>this._inputNode).validate();
|
||||||
|
Loading…
Reference in New Issue
Block a user