Class: Date
Instance Method Summary collapse
Instance Method Details
#<=>(other) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/utopia/extensions/date.rb', line 29 def <=>(other) if other.class == Date old_compare(other) else if Time === other other = other.to_datetime end if DateTime === other result = old_compare(other.to_date) if result == 0 && other.day_fraction > 0 -1 else result end end end end |
#old_compare ⇒ Object
27 |
# File 'lib/utopia/extensions/date.rb', line 27 alias_method :old_compare, :<=> |