Incorrect "month" date for Feb when it is a leap year
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.
2.2.2 :032 > Chronic.parse("friday")
=> 2016-02-26 12:00:00 -0800
2.2.2 :033 > Chronic.parse("monday")
=> 2016-02-29 12:00:00 -0800
2.2.2 :034 > Chronic.parse("month")
=> 2016-02-28 00:00:00 -0800
2.2.2 :035 > Date.today.end_of_month
=> Mon, 29 Feb 2016
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