Minor fixes

This commit is contained in:
Arkadiusz Fal
2022-12-18 13:39:39 +01:00
parent ba1ec7c559
commit af85c67163
7 changed files with 17 additions and 6 deletions

View File

@@ -217,7 +217,15 @@ struct Video: Identifiable, Equatable, Hashable {
}
var publishedDate: String? {
(published.isEmpty || published == "0 seconds ago") ? publishedAt?.timeIntervalSince1970.formattedAsRelativeTime() : published
guard let publishedAt else {
return (published.isEmpty || published == "0 seconds ago") ? nil : published
}
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .short
dateFormatter.timeStyle = .none
return dateFormatter.string(from: publishedAt)
}
var viewsCount: String? {