diff --git a/iOSClient/Data/NCManageDatabase+Trash.swift b/iOSClient/Data/NCManageDatabase+Trash.swift index 186f031bae..a34b21cf77 100644 --- a/iOSClient/Data/NCManageDatabase+Trash.swift +++ b/iOSClient/Data/NCManageDatabase+Trash.swift @@ -117,7 +117,7 @@ extension NCManageDatabase { do { let realm = try Realm() realm.refresh() - let results = realm.objects(tableTrash.self).filter("account == %@ AND filePath == %@", account, filePath).sorted(byKeyPath: "date", ascending: false) + let results = realm.objects(tableTrash.self).filter("account == %@ AND filePath == %@", account, filePath).sorted(byKeyPath: "trashbinDeletionTime", ascending: false) return Array(results.map { tableTrash.init(value: $0) }) } catch let error as NSError { NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access to database: \(error)") diff --git a/iOSClient/Trash/Cell/NCTrashCellProtocol.swift b/iOSClient/Trash/Cell/NCTrashCellProtocol.swift index c05a859e63..84cd9214d6 100644 --- a/iOSClient/Trash/Cell/NCTrashCellProtocol.swift +++ b/iOSClient/Trash/Cell/NCTrashCellProtocol.swift @@ -39,13 +39,13 @@ extension NCTrashCellProtocol where Self: UICollectionViewCell { self.labelTitle.text = tableTrash.trashbinFileName self.labelTitle.textColor = NCBrandColor.shared.textColor if self is NCTrashListCell { - self.labelInfo?.text = NCUtility().dateDiff(tableTrash.date as Date) + self.labelInfo?.text = NCUtility().dateDiff(tableTrash.trashbinDeletionTime as Date) } else { let dateFormatter = DateFormatter() dateFormatter.dateStyle = .short dateFormatter.timeStyle = .none dateFormatter.locale = Locale.current - self.labelInfo?.text = dateFormatter.string(from: tableTrash.date as Date) + self.labelInfo?.text = dateFormatter.string(from: tableTrash.trashbinDeletionTime as Date) } if tableTrash.directory { self.imageItem.image = NCImageCache.images.folder