fix: Deployment running for - without "ago"

This commit is contained in:
Tim Koch
2024-09-01 22:01:05 +02:00
parent 90267a96c1
commit f072823f00

View File

@@ -106,7 +106,7 @@
<div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')"> <div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')">
<div> <div>
@if ($deployment->status !== 'in_progress') @if ($deployment->status !== 'in_progress')
Finished <span x-text="measure_since_started()">0s</span> in Finished <span x-text="measure_since_started()">0s</span> ago in
<span class="font-bold" x-text="measure_finished_time()">0s</span> <span class="font-bold" x-text="measure_finished_time()">0s</span>
@else @else
Running for <span class="font-bold" x-text="measure_since_started()">0s</span> Running for <span class="font-bold" x-text="measure_since_started()">0s</span>
@@ -157,7 +157,7 @@
} }
}, },
measure_since_started() { measure_since_started() {
return dayjs.utc(created_at).fromNow(); return dayjs.utc(created_at).fromNow(true); // "true" prevents the "ago" suffix
}, },
})) }))
</script> </script>