Closed errm closed 12 years ago
Is this a similar output error?
ChronicDuration.output(ChronicDuration.parse("18 months")) => "1 yr 6 mos -5 days"
I assume this is a bug, but I am not really familiar with all the time issues:
ChronicDuration.parse("18 months") => 46656000
ChronicDuration.parse("1 year 6 months") => 47088000
yes it seems my changes introduced that . . .
So it seems correct in a way.
what exactly is 18 months 18 * 30 * 24 * 3600, but 1 year 6 months should be (6 30 + 365) * 24 \ 3600
so I think we should preserve those differences when we parse. But output needs to be something more like 1 year 5 months 25 days or 18 months.....
ChronicDuration.output(ChronicDuration.parse("2 year")) => "2 yrs 10 days"
Output is off by 5 days per year as
12 * 30 != 365