tmlee / time_difference

The missing Ruby method to print out time difference (duration) in year, month, week, day, hour, minute, and second.
https://rubygems.org/gems/time_difference
MIT License
305 stars 92 forks source link

Calculate in_general using year/month/day difference #8

Closed matrinox closed 8 years ago

matrinox commented 9 years ago

...instead of calculating by day difference and assuming static values for year to day conversion, etc.

For example, 1 year is not 360 days nor even 365 days. Need to have two dates in context. Downside is in_general can't be called with values like 5.days that have no date value.

matrinox commented 9 years ago

No specs yet, so it should fail but if you don't want to wait for specs, go ahead and use it

tmlee commented 8 years ago

Some test to reinforce this would be good to have, so i am closing this pull request for now.