Skip to content

Commit

Permalink
Fix date inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Feb 28, 2024
1 parent 65c97ed commit 54cf7e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions resources/views/components/incidents.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</div>

<div class="flex justify-between">
<a href="{{ route('cachet.status-page', ['from' => $from]) }}" class="text-zinc-500 dark:text-zinc-400 hover:underline text-sm">
<a href="{{ route('cachet.status-page', ['from' => $nextPeriodFrom]) }}" class="text-zinc-500 dark:text-zinc-400 hover:underline text-sm">
{{ __('Previous Incidents') }}
</a>

@if($canPageForward)
<a href="{{ route('cachet.status-page', ['from' => $to]) }}" class="text-zinc-500 dark:text-zinc-400 hover:underline text-sm">
<a href="{{ route('cachet.status-page', ['from' => $nextPeriodTo]) }}" class="text-zinc-500 dark:text-zinc-400 hover:underline text-sm">
{{ __('Newer Incidents') }}
</a>
@endif
Expand Down
8 changes: 5 additions & 3 deletions src/View/Components/Incidents.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public function render(): View
$endDate,
$this->appSettings->only_disrupted_days
),
'from' => $startDate->clone()->subDays($incidentDays)->toDateString(),
'to' => $startDate->clone()->addDays($incidentDays)->toDateString(),
'canPageForward' => $startDate->clone()->addDays($incidentDays)->isBefore(now()),
'from' => $startDate->toDateString(),
'to' => $endDate->toDateString(),
'nextPeriodFrom' => $startDate->clone()->subDays($incidentDays + 1)->toDateString(),
'nextPeriodTo' => $startDate->clone()->addDays($incidentDays + 1)->toDateString(),
'canPageForward' => $startDate->clone()->isBefore(now()),
]);
}

Expand Down

0 comments on commit 54cf7e2

Please sign in to comment.