RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

How do you check whether a date is in a date range?

We all know (start_date..end_date).include?(this_date) is quite slow. If you have seen Ben Orenstein’s talk about refactoring, you might know (…).cover? is much faster… but is it fast enough?

No. Use Date#between? instead.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in