Open codered opened 8 years ago
why month
should return end of month? it's actually not supported and that it returns anything at all is just pure luck.
for now you can use
Chronic.parse("1 day before next month", :guess => :begin)
=> 2016-02-29 00:00:00 +0200
@codered This issue is not only for Feb, I also have the same issue for August.
2.1.0 :021 > Chronic.parse("today")
=> 2016-08-23 21:00:00 +0530
2.1.0 :023 > Date.today.end_of_month
=> Wed, 31 Aug 2016
2.1.0 :022 > Chronic.parse("month")
=> 2016-08-28 00:00:00 +0530
Also year function gives me an unexpected result.
2.1.0 :024 > Chronic.parse("year")
=> 2016-10-28 00:00:00 +0530
The month function should return the last day of the month, however, for leap years (this year), the last day of the month being returned is 2/28 instead of 2/29.