mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 19:23:43 +01:00
Displays “TODAY” as section header for logged errors that occured that day
This commit is contained in:
@@ -287,8 +287,15 @@ extension ErrorLogViewController
|
|||||||
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
|
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
|
||||||
{
|
{
|
||||||
let indexPath = IndexPath(row: 0, section: section)
|
let indexPath = IndexPath(row: 0, section: section)
|
||||||
|
|
||||||
let loggedError = self.dataSource.item(at: indexPath)
|
let loggedError = self.dataSource.item(at: indexPath)
|
||||||
return loggedError.localizedDateString
|
|
||||||
|
if Calendar.current.isDateInToday(loggedError.date)
|
||||||
|
{
|
||||||
|
return NSLocalizedString("Today", comment: "")
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return loggedError.localizedDateString
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user