Search filter fixes

This commit is contained in:
Ilya Laktyushin
2020-09-29 04:03:20 +04:00
parent 1d1e3de5d5
commit 8b362c60f4
3 changed files with 31 additions and 12 deletions

View File

@@ -106,11 +106,13 @@ func suggestDates(for string: String, strings: PresentationStrings, dateTimeForm
if stringComponents.count < 3 {
for i in 0..<5 {
if let date = calendar.date(byAdding: .year, value: -i, to: resultDate), date < now {
result.append((nil, date, nil))
let lowerDate = getLowerDate(for: resultDate)
result.append((lowerDate, date, nil))
}
}
} else if resultDate < now {
result.append((nil, resultDate, nil))
let lowerDate = getLowerDate(for: resultDate)
result.append((lowerDate, resultDate, nil))
}
}
let dd = try NSDataDetector(types: NSTextCheckingResult.CheckingType.date.rawValue)