Parsing part was not migrated to luxon
This commit is contained in:
@ -291,7 +291,17 @@ class TpDateInput extends EventHelpers(ControlState(FormElement(LitElement))) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const date = parse(i0 + '-' + i1 + '-' + i2, this._inputAssign.join('-'), new Date());
|
// Convert luxon format to match input assignment
|
||||||
|
const luxonFormat = this._inputAssign.map(part => {
|
||||||
|
switch (part) {
|
||||||
|
case 'MM': return 'LL';
|
||||||
|
case 'dd': return 'dd';
|
||||||
|
case 'y': return 'yyyy';
|
||||||
|
default: return part;
|
||||||
|
}
|
||||||
|
}).join('-');
|
||||||
|
|
||||||
|
const dt = DateTime.fromFormat(i0 + '-' + i1 + '-' + i2, luxonFormat);
|
||||||
|
|
||||||
if (dt.isValid) {
|
if (dt.isValid) {
|
||||||
this.inputs[0].invalid = false;
|
this.inputs[0].invalid = false;
|
||||||
|
Reference in New Issue
Block a user