time_difference
time_difference copied to clipboard
Feature: Add support for calendar years, calendar months and more
- Supports inclusive vs exclusive date ranges
- Respects timezones
- Correctly calculates differences over leap years (does not assume 365.25 days in a year or 30.42 days in a month)
- Correctly corrects for daylight savings
- Support for in_calendar_years and in_calendar_months for monthly and yearly billing cycle calculation support
- Use of rounding as an option rather than hardcoded
2
(set as default option to prevent breakage)
Ref:
- https://github.com/tmlee/time_difference/issues/29 – inclusive date ranges (n/a for times)
- https://github.com/tmlee/time_difference/issues/39 – varying numbers of days per month
bump
> TimeDifference.between('Oct 21, 2017'.to_time, Time.now).in_years
=> 1.45
IMO: Please rename your fork (https://github.com/IQTHINK/time_difference) and become the maintainer. This gem appears to be abandoned. 9 open PR's 😞