le8i2digy: Add a refresh button to the Home feed header and singularize one comment
This commit is contained in:
@@ -194,6 +194,11 @@ export function upgradeVideos(current: CardPost[], fresh: CardPost[]): CardPost[
|
||||
return changed ? next : current;
|
||||
}
|
||||
|
||||
/** "1 comment", "0 comments", "2 comments". */
|
||||
export function commentsLabel(count: number): string {
|
||||
return count === 1 ? "1 comment" : `${count} comments`;
|
||||
}
|
||||
|
||||
export function relativeTime(publishedAt: string | null, now: number = Date.now()): string {
|
||||
const t = publishedAt ? Date.parse(publishedAt) : NaN;
|
||||
if (!Number.isFinite(t)) return "";
|
||||
|
||||
Reference in New Issue
Block a user