-
Notifications
You must be signed in to change notification settings - Fork 462
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
Incorrect date parse #375
Comments
It's fixed in my unfinished rewrite branch. |
@davispuh yes, this branch works with my example but has many another issues. |
That's kinda expected behavior. There are 3 different ways how to interpret it and it just guesses it as best as it's possible. In [[ScalarYear, SeparatorSlash, ScalarMonth, SeparatorSlash, ScalarDay], :handle_sy_sm_sd],
...
[[ScalarMonth, SeparatorSlash, ScalarDay, SeparatorSlash, ScalarYear, [SeparatorDot, Scalar, :none]], :handle_sm_sd_sy],
...
[[ScalarDay, SeparatorSlash, ScalarMonth, SeparatorSlash, ScalarYear, [SeparatorDot, Scalar, :none]], :handle_sd_sm_sy], |
it is possible to set default format %m%d%y ? |
Default I don't think so. But you could remove other formats with monkey patching. Anyway firstly you need to pass class Chronic::DateDefinitions
def definitions
[]
end
end
class Chronic::ShortDateDefinitions
def definitions
[]
end
end
class Chronic::DateTimeDefinitions
def definitions
[]
end
end |
it is possible to fix reported issue in this master branch? |
It will be fixed when |
[10] pry(#)> Chronic.parse("4/30")
=> Mon, 30 Apr 2018 12:00:00 PDT -07:00
[11] pry(#)> Chronic.parse("4/31")
=> nil
[12] pry(#)> Chronic.parse("4/32")
=> Fri, 16 Apr 2032 00:00:00 PDT -07:00
In last example should be nil
The text was updated successfully, but these errors were encountered: