Open dylandrendel opened 6 months ago
Just found this issue comming from the Moment adapter just having switched to Luxon. I expected it to behave about the same - but input totally doesn't!
Using moment the date input was pretty intuitive: Just putting a 15 was parsed to 15th of current month & year. 15.5 (Germany) was parsed to 15th of 5th month and so on. Using the Luxon adapter now always expects me to input a full date, even including the zeros! Or am I mistaken? Is there any possibility to make it behave about the same?
And is the original issue going to be solved, soon? Seems pretty drastical to me.
Is this a regression?
The previous version in which this bug was not present was
N/A
Description
In
/src/material-luxon-adapter/adapter/luxon-date-adapter.ts#L174
the date is formatted with ISO before the user provided formats.This leads to a bug where specific text inputs are not parsing correctly according to the user provided formats.
For example, I provide the format
MMyyyy
to the parse dateInputs array. This gets ignored for certain string inputs. One example is082001
. This gets parsed asyyyyMM
by the ISO check before checking my provided formats array and returns incorrectly as01/0820
instead of the desired08/2001
.Reproduction
StackBlitz link: https://stackblitz.com/edit/ocbei5?file=package.json Steps to reproduce:
MMyyyy
to the parse dateInputs arrayExpected Behavior
Gets parsed correctly as 08/2001 and displays as 08/2001.
Actual Behavior
Gets parsed incorrectly by ISO check as 01/0820 and displays as 01/0820.
Environment