Created
February 16, 2020 23:46
-
-
Save Ksen17/dd1ad876519c01fd677357ffd1ba7eec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Foundation | |
extension Date { | |
static func isSameDay(date1: Date, date2: Date) -> Bool { | |
let diff = Calendar.current.dateComponents([.day], from: date1, to: date2) | |
if diff.day == 0 { | |
return true | |
} else { | |
return false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment