RubyFlow The Ruby and Rails community linklog

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