diff --git a/frontend/src/lib/components/ItemList.svelte b/frontend/src/lib/components/ItemList.svelte index 1ef8978..e0fe56b 100644 --- a/frontend/src/lib/components/ItemList.svelte +++ b/frontend/src/lib/components/ItemList.svelte @@ -96,18 +96,20 @@ if (e.target instanceof HTMLInputElement) { filter.keyword = e.target.value; } - }, 1000); + }, 500); function fromNow(d: Date) { d = new Date(d); const now = new Date(); const hours = Math.floor((now.getTime() - d.getTime()) / (1000 * 60 * 60)); const days = Math.floor(hours / 24); + const months = Math.floor(days / 30); const years = Math.floor(days / 365); if (years > 0) return years + 'y'; + if (months > 0) return months + 'm'; if (days > 0) return days + 'd'; if (hours > 0) return hours + 'h'; - return 'now'; + return '?'; } const actions: { icon: ComponentType; tooltip: string; handler: () => void }[] = [ @@ -163,12 +165,12 @@

{item.title}

-
+
{item.feed.name} - + {fromNow(item.pub_date)}
@@ -185,7 +187,7 @@ {#if data.items.total > 1} -
+