Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #65 from michaeleisel/nsdate_comparable
Browse files Browse the repository at this point in the history
removed unnecessary methods
  • Loading branch information
pNre committed Feb 2, 2015
2 parents 48f084a + c980454 commit 5cdf6c2
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions ExSwift/NSDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,27 +229,16 @@ public extension NSDate{
}
}

// MARK: Comparable functions
extension NSDate: Equatable {
}

public func ==(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedSame
}

public func <(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedAscending
}

public func >(lhs: NSDate, rhs: NSDate) -> Bool {
return !(lhs <= rhs)
}

public func <=(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs < rhs || lhs == rhs
}

public func >=(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs > rhs || lhs == rhs
extension NSDate: Comparable {
}

extension NSDate: Comparable {
public func <(lhs: NSDate, rhs: NSDate) -> Bool {
return lhs.compare(rhs) == NSComparisonResult.OrderedAscending
}

0 comments on commit 5cdf6c2

Please sign in to comment.