Skip to content

Commit

Permalink
Display creationTime as date (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: Immanuel Kunz <[email protected]>
  • Loading branch information
oxisto and immqu authored Nov 8, 2023
1 parent b1f4e41 commit 7ed261f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/components/NodeDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@
<p class="truncate ...">
{#if k == 'url'}
<a href={v} target="_blank">{v}</a>
{:else if k == 'creationTime'}
<time datetime={new Date(v * 1000).toISOString()}>
{Intl.DateTimeFormat(navigator.language, {
weekday: 'long',
year: 'numeric',
month: 'long',
hour: 'numeric',
minute: 'numeric',
day: 'numeric'
}).format(v * 1000)}
</time>
{:else}
{v}
{/if}
Expand Down

0 comments on commit 7ed261f

Please sign in to comment.