2 Commits
2.0.0 ... 2.0.1

Author SHA1 Message Date
pk
1e5a4bc3d3 Bump version 2025-06-27 10:55:02 +02:00
pk
3641de7ebd Parsing part was not migrated to luxon 2025-06-27 10:54:39 +02:00
2 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@tp/tp-date-input",
"version": "2.0.0",
"version": "2.0.1",
"description": "",
"main": "tp-date-input.js",
"scripts": {

View File

@ -291,7 +291,17 @@ class TpDateInput extends EventHelpers(ControlState(FormElement(LitElement))) {
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) {
this.inputs[0].invalid = false;