Skip to content

Instantly share code, notes, and snippets.

@jklausa
Created July 5, 2014 14:49
Show Gist options
  • Save jklausa/3fff60b7f51579fff673 to your computer and use it in GitHub Desktop.
Save jklausa/3fff60b7f51579fff673 to your computer and use it in GitHub Desktop.
import Foundation
@infix func ==(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs == rhs
}
@infix func <=(lhs: NSDate, rhs: NSDate) -> Bool {
return !(lhs > rhs)
}
@infix func >=(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs == rhs || lhs > rhs
}
@infix func >(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedAscending
}
extension NSDate: Equatable {
}
extension NSDate: Comparable {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment