time_difference icon indicating copy to clipboard operation
time_difference copied to clipboard

Feature: Add support for calendar years, calendar months and more

Open jufemaiz opened this issue 6 years ago • 3 comments

  • 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)

jufemaiz avatar May 14 '18 14:05 jufemaiz

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

jufemaiz avatar May 14 '18 14:05 jufemaiz

bump

jufemaiz avatar Jan 31 '19 06:01 jufemaiz

 > 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 😞

bmoelk avatar Apr 02 '19 01:04 bmoelk