UtopiaSourceUtopiaExtensionsTimeDateComparison

module TimeDateComparison

Provides comparison operator extensions.

Definitions

def <=>(other)

Compare a time with a date-like or otherwise comparable value.

Signature

parameter other Object

The object to compare.

returns Integer | Nil

The comparison result.

Implementation

def <=>(other)
	if Date === other or DateTime === other
		self.to_datetime <=> other
	else
		super
	end
end