Created
March 23, 2017 01:19
-
-
Save Ben-G/b7b000caf3091da1c3d063019be0a3f1 to your computer and use it in GitHub Desktop.
Date Equality Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Date { | |
public static func ==(lhs: Date, rhs: Date) -> Bool { | |
return lhs.timeIntervalSinceReferenceDate == rhs.timeIntervalSinceReferenceDate || | |
lhs.timeIntervalSince1970 == rhs.timeIntervalSince1970 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment