Skip to content

Instantly share code, notes, and snippets.

@Ksen17
Created February 16, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ksen17/dd1ad876519c01fd677357ffd1ba7eec to your computer and use it in GitHub Desktop.
Save Ksen17/dd1ad876519c01fd677357ffd1ba7eec to your computer and use it in GitHub Desktop.
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