Flowdock
between?(min, max) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Show source
Register or log in to add new notes.
December 23, 2009
0 thanks

Compare dates

You can check a date resides between two dates.

Date.today.between?(Date.yesterday, Date.tomorrow)

will return true

Date.yesterday.between?(Date.today, Date.tomorrow)

will return false

March 29, 2013
0 thanks

Edge case

Have look how #between? handle adge case. It’s different from DateTime’s.

Date.yesterday.between?(Date.yesterday, Date.tomorrow)
=> true

Date.tomorrow.between?(Date.yesterday, Date.tomorrow)
=> true