-
Notifications
You must be signed in to change notification settings - Fork 460
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
can parse invalid dates #50
Comments
This is actually because of how the Ruby Time class deals with day overflows. An example:
The Time class raises an The internals of Chronic don't actually care what I'll have a think about this and leave this issue open for discussion, because I do agree with you. Libraries shouldn't rely on this functionality but it's how Chronic has always done it, so there's always that one exception to the rule. |
Summoning @mojombo on this discussion. We can go one of 3 ways:
|
One might expect Chronic.parse('30 February 2011') to yield nil... as there never a 30'th of February... yet it yields 02 March 2011.
30 days hath September, April, June and November
Same-ish goes for the "31st" of those 4 months too yielding the 1st of the following month.
Same-ish goes for Chronic.parse('31 February 2011') yielding 03 March 2011... and the 29th of February yielding the 1st of March on non-leap years.
The text was updated successfully, but these errors were encountered: