From b7f0ec4bfbdb4785ceed767e6587a08c0265e635 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 19 Dec 2022 12:13:27 +0100 Subject: [PATCH] Back to previous date format --- Model/Video.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Model/Video.swift b/Model/Video.swift index 0b14bfc9..172a5826 100644 --- a/Model/Video.swift +++ b/Model/Video.swift @@ -217,15 +217,7 @@ struct Video: Identifiable, Equatable, Hashable { } var publishedDate: String? { - 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) + (published.isEmpty || published == "0 seconds ago") ? publishedAt?.timeIntervalSince1970.formattedAsRelativeTime() : published } var viewsCount: String? {