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

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to