Skip to content

Commit b8646cf

Browse files
Adds time element to improve dates (#100)
Co-authored-by: James Brooks <[email protected]>
1 parent a76ab8e commit b8646cf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

resources/views/components/incident-timeline.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66
<div class="flex items-center gap-2 text-sm text-zinc-500 dark:text-zinc-400" x-data="{ from: new Date(@js($from)), to: new Date(@js($to)) }">
77
<div><x-heroicon-m-calendar class="size-4" /></div>
8-
<div><span x-html="from.toLocaleDateString()"></span> &mdash; <span x-html="to.toLocaleDateString()"></span></div>
8+
<div><time datetime="{{ $from }}" x-text="from.toLocaleDateString()"></time> &mdash; <time datetime="{{ $to }}" x-text="to.toLocaleDateString()"></time></div>
99
</div>
1010
</div>
1111

resources/views/components/incident.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
])
55

66
<div class="relative flex flex-col gap-5" x-data="{ forDate: new Date(@js($date)) }">
7-
<h3 class="text-xl font-semibold" x-html="forDate.toLocaleDateString()"></h3>
7+
<h3 class="text-xl font-semibold"><time datetime="{{ $date }}" x-text="forDate.toLocaleDateString()"></time></h3>
88
@forelse($incidents as $incident)
99
<div x-data="{ timestamp: new Date(@js($incident->timestamp)) }" class="bg-white border divide-y rounded-lg ml-9 dark:divide-zinc-700 dark:border-zinc-700 dark:bg-zinc-800">
1010
<div @class([
@@ -19,7 +19,7 @@
1919
<a href="{{ route('cachet.status-page.incident', $incident) }}">{{ $incident->name}}</a>
2020
</h3>
2121
<span class="text-xs text-zinc-500 dark:text-zinc-400">
22-
{{ $incident->timestamp->diffForHumans() }} — <span x-text="timestamp.toLocaleString()"></span>
22+
{{ $incident->timestamp->diffForHumans() }} — <time datetime="{{ $incident->timestamp->toW3cString() }}" x-text="timestamp.toLocaleString()"></time>
2323
</span>
2424
</div>
2525
<div class="flex justify-start sm:justify-end">
@@ -44,7 +44,7 @@
4444
<x-cachet::incident-update-status :update="$update" />
4545
{{-- <h3 class="text-lg font-semibold">Incident Update Title</h3>--}}
4646
<span class="text-xs text-zinc-500 dark:text-zinc-400">
47-
{{ $update->created_at->diffForHumans() }} — <span x-text="timestamp.toLocaleString()"></span>
47+
{{ $update->created_at->diffForHumans() }} — <time datetime="{{ $update->created_at->toW3cString() }}" x-text="timestamp.toLocaleString()"></time>
4848
</span>
4949
<div class="mt-1 prose-sm md:prose md:prose-zinc dark:text-zinc-100">
5050
{!! $update->formattedMessage() !!}

resources/views/components/schedule.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ $schedule->name}}
1010
</h3>
1111
<span class="text-xs text-zinc-500 dark:text-zinc-400">
12-
{{ $schedule->scheduled_at->diffForHumans() }} — <span x-text="timestamp.toLocaleString()"></span>
12+
{{ $schedule->scheduled_at->diffForHumans() }} — <time datetime="{{ $schedule->scheduled_at->toW3cString() }}" x-text="timestamp.toLocaleString()"></time>
1313
</span>
1414
</div>
1515
<div class="flex justify-start sm:justify-end">

0 commit comments

Comments
 (0)