Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -4,9 +4,15 @@
|
||||
import { timeFormat } from '$ui/stores/time-zone.js';
|
||||
import { uiNow } from '$ui/stores/servers.js';
|
||||
|
||||
let { value, missing = '—', class: className }: { value: Timestamp; missing?: string; class?: string } = $props();
|
||||
let {
|
||||
value,
|
||||
missing = '—',
|
||||
class: className
|
||||
}: { value: Timestamp; missing?: string; class?: string } = $props();
|
||||
const iso = $derived(timestampISO(value));
|
||||
const now = $derived(browser ? $uiNow : Date.now());
|
||||
</script>
|
||||
|
||||
{#if iso}<time class={className} datetime={iso} title={$timeFormat.dateTime(value)}>{$timeFormat.relative(value, now)}</time>{:else}<span class={className}>{missing}</span>{/if}
|
||||
{#if iso}<time class={className} datetime={iso} title={$timeFormat.dateTime(value)}
|
||||
>{$timeFormat.relative(value, now)}</time
|
||||
>{:else}<span class={className}>{missing}</span>{/if}
|
||||
|
||||
Reference in New Issue
Block a user