Skip to content

Commit

Permalink
Display creationTime as date
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Nov 8, 2023
1 parent fc5bb09 commit 2aad3d2
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 2aad3d2

Please sign in to comment.