When comparing yesterday's date with .compare(.isTomorrow), the function is returning true which is wrong.
Example:
let date = Date()
let tomorrow = date.offset(.day, value: 1)!
let yesterday = date.offset(.day, value: -1)!
//In version 5.0.1, these comparison returns `true`, which is a bug.
if tomorrow.compare(.isYesterday) {
print(".isYesterday COMPARISION WRONG")
}
if yesterday.compare(.isTomorrow) {
print(".isTomorrow COMPARISION WRONG")
}
The same happens for comparing the following DateComparisonType
When comparing yesterday's date with
.compare(.isTomorrow)
, the function is returningtrue
which is wrong.Example:
The same happens for comparing the following
DateComparisonType