-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date parse: lenient about zero-padding date fields #695
Comments
Some ideas... We could add an option to parseDate() to modify the lenient behavior, e.g., |
Would be interesting how the current test suite "reacts" to that. Even if that comes up without regressions, it might justify a major release. |
|
The question is should we favor backward compatibility (a) or to consider it a bug an eventually implement a |
Options for behaviour that looks like a bug vs breaking backwards compatibility? Not a great choice either way. I still wonder how likely a bugfix is to actually break anything. That would be the case if an app expects |
Yeap, I also can't think if a case where one would expect
I’m inclined to consider it a bug and make a patch. |
Date parser is strict about parsing zero-padded date fields, for example parsing
yMd
skeleton forpt
(that means patterndd/MM/y
), we have:Though it's impossible to set parser to parse non-zero-padded day and month for
pt
unless it's usedraw
to pass the pattern itself (which is not recommended). Therefore, parser should be lenient about parsing those date fields, specially the ones below for the analogous reason.date: "short"
may includey
oryy
, alsoy
isn't the non-zero-padded foryy
, what makes it even more mandatory to have a way to parse non-zero-addedyy
.skeleton: "yMd"
(i.e., oneM
) may includeMM
as the pattern); similarlyL
.skeleton: "yMd"
(i.e., oned
) may included
ordd
skeleton: "hms"
(i.e., oneh
) may includeh
orhh
; similarlyHKk
.skeleton: "hms"
(i.e., onem
) always includesmm
skeleton: "hms"
(i.e., ones
) always includesss
The text was updated successfully, but these errors were encountered: