Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -3,14 +3,25 @@
|
||||
import { formatTimeOffset } from '$ui/duration.js';
|
||||
import { timeFormat } from '$ui/stores/time-zone.js';
|
||||
|
||||
let { value, start, missing = 'Not recorded' }: { value: Timestamp; start: Timestamp; missing?: string } = $props();
|
||||
let {
|
||||
value,
|
||||
start,
|
||||
missing = 'Not recorded'
|
||||
}: { value: Timestamp; start: Timestamp; missing?: string } = $props();
|
||||
const iso = $derived(timestampISO(value));
|
||||
const offset = $derived(formatTimeOffset(start, value));
|
||||
const absolute = $derived($timeFormat.dateTime(value));
|
||||
</script>
|
||||
|
||||
{#if iso}<time datetime={iso} title={absolute} aria-label={offset ? `${offset} from operation start · ${absolute}` : undefined}>{offset ?? absolute}</time>{:else}<span>{missing}</span>{/if}
|
||||
{#if iso}<time
|
||||
datetime={iso}
|
||||
title={absolute}
|
||||
aria-label={offset ? `${offset} from operation start · ${absolute}` : undefined}
|
||||
>{offset ?? absolute}</time
|
||||
>{:else}<span>{missing}</span>{/if}
|
||||
|
||||
<style>
|
||||
time { font-variant-numeric: tabular-nums; }
|
||||
time {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user