Module: Utopia::Extensions::DateTimeComparison
- Defined in:
- lib/utopia/extensions/date_comparisons.rb
Overview
Provides comparison operator extensions.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Compare a date with a time or otherwise comparable value.
Instance Method Details
#<=>(other) ⇒ Object
Compare a date with a time or otherwise comparable value.
31 32 33 34 35 36 37 |
# File 'lib/utopia/extensions/date_comparisons.rb', line 31 def <=>(other) if Time === other self.to_datetime <=> other.to_datetime else super end end |