Skip to content

Commit 40a234d

Browse files
committed
Updates feed highlight card date display
Replaces the specific date formatting with a more user-friendly "time ago" display in the feed highlight card. This change improves the user experience by presenting relative time information, like "5 minutes ago" or "yesterday", instead of fixed date formats, making it easier for users to quickly understand when the news was published.
1 parent 50b6e1d commit 40a234d

2 files changed

Lines changed: 2 additions & 136 deletions

File tree

MacMagazine/Features/NewsLibrary/Sources/NewsLibrary/Extensions/DateExtensions.swift

Lines changed: 0 additions & 134 deletions
This file was deleted.

MacMagazine/Features/NewsLibrary/Sources/NewsLibrary/Views/Components/FeedHighlightCardView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public struct FeedHighlightCardView: View {
8989
private var dateLabel: some View {
9090
HStack(spacing: 6) {
9191
Image(systemName: "calendar")
92-
Text(post.pubDate.feedDateTimeDisplay)
92+
Text(post.pubDate.toTimeAgoDisplay(showTime: true))
9393
}
9494
.font(.subheadline)
9595
.foregroundStyle(.white.opacity(0.85))
@@ -102,7 +102,7 @@ public struct FeedHighlightCardView: View {
102102
if post.favorite {
103103
label += ", favoritado"
104104
}
105-
label += ", publicado em \(post.pubDate.formatted(as: "dd 'de' MMMM 'de' yyyy 'às' HH:mm"))"
105+
label += ", publicado em \(post.pubDate.toTimeAgoDisplay(showTime: true))"
106106
return label
107107
}
108108

0 commit comments

Comments
 (0)