[Feature Request] Human-readable DateTime comparisons

Hi there,

For some reason, comparing dates/times with < and > confuses my brain and has resulted in me second-guessing my code, and accidently inverting my time comparison logic.

What I was looking for was a method on DateTime so that I could do comparisons like: some_time.more_recent_than?(another_time) or some_time.comes_after?(another_time).

Since there were no methods like that in ActiveSupport, I created a gem: https://github.com/allenan/human_time. It’s already helped me a lot in my code, and I’ve gotten positive feedback on it on GitHub (113 stars and 1 contribution to date) and on Twitter.

I’d be happy to submit a PR that adds some of those methods to ActiveSupport if that would be a valuable addition.

Andrew

Wouldn't put this in AS, really.

Albeit I understand that you find comparing dates and times confusing, the
arrow of time from left to right is intuitive and matches the ordering
defined in the classes quite naturally I'd say. Also, it is the ordering
for these kind of data types you find in SQL and virtually anywhere else.

Not saying you should not find it confusing, not at all, that is very
personal, only explaining why I don't see it in AS. A gem is better here in
my view.