DatePickerAlert + DateFormat

This commit is contained in:
relikd
2020-06-11 01:32:50 +02:00
parent 946acc2460
commit 0a53898797
14 changed files with 195 additions and 72 deletions

View File

@@ -130,6 +130,13 @@ extension SQLiteDatabase {
// MARK: read
func dnsLogsMinDate() -> Timestamp? {
try? run(sql:"SELECT min(ts) FROM heap") {
try ifStep($0, SQLITE_ROW)
return sqlite3_column_int64($0, 0)
}
}
/// Select min and max row id with given condition `ts >= ? AND ts < ?`
/// - Returns: `nil` in case no rows are matching the condition
func dnsLogsRowRange(between ts: Timestamp, and ts2: Timestamp) -> SQLiteRowRange? {

View File

@@ -16,8 +16,8 @@ extension GroupedDomain {
extension GroupedDomain {
var detailCellText: String { get {
return blocked > 0
? "\(lastModified.asDateTime())\(blocked)/\(total) blocked"
: "\(lastModified.asDateTime())\(total)"
? "\(DateFormat.seconds(lastModified))\(blocked)/\(total) blocked"
: "\(DateFormat.seconds(lastModified))\(total)"
}
}
}