fix: null guard on price_updated_at, consistent price formatting, use str() helper
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
@if (! empty($results))
|
@if (! empty($results))
|
||||||
<p class="mb-3 text-sm text-zinc-500 dark:text-zinc-400">
|
<p class="mb-3 text-sm text-zinc-500 dark:text-zinc-400">
|
||||||
{{ $meta['count'] }} {{ Str::plural('station', $meta['count']) }} found
|
{{ $meta['count'] }} {{ str('station')->plural($meta['count']) }} found
|
||||||
· Cheapest: {{ number_format($meta['lowest_pence'] / 100, 1) }}p
|
· Cheapest: {{ number_format($meta['lowest_pence'] / 100, 1) }}p
|
||||||
· Average: {{ number_format($meta['avg_pence'] / 100, 1) }}p
|
· Average: {{ number_format($meta['avg_pence'] / 100, 1) }}p
|
||||||
</p>
|
</p>
|
||||||
@@ -87,10 +87,10 @@
|
|||||||
|
|
||||||
<div class="ml-4 shrink-0 text-right">
|
<div class="ml-4 shrink-0 text-right">
|
||||||
<p class="text-xl font-bold text-zinc-900 dark:text-zinc-100">
|
<p class="text-xl font-bold text-zinc-900 dark:text-zinc-100">
|
||||||
{{ $station['price'] }}p
|
{{ number_format($station['price'], 1) }}p
|
||||||
</p>
|
</p>
|
||||||
<p class="text-xs text-zinc-400 dark:text-zinc-500">
|
<p class="text-xs text-zinc-400 dark:text-zinc-500">
|
||||||
{{ \Carbon\Carbon::parse($station['price_updated_at'])->diffForHumans() }}
|
{{ $station['price_updated_at'] ? \Carbon\Carbon::parse($station['price_updated_at'])->diffForHumans() : 'Unknown' }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<p class="text-sm text-zinc-500 dark:text-zinc-400">
|
<p class="text-sm text-zinc-500 dark:text-zinc-400">
|
||||||
No stations found within {{ $radius }} {{ Str::plural('mile', $radius) }} of "{{ $search }}".
|
No stations found within {{ $radius }} {{ str('mile')->plural($radius) }} of "{{ $search }}".
|
||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user