@php $hasRunningTimer = $activeTimer && $activeTimer->ended_at === null; $startedAtIso = $hasRunningTimer ? $activeTimer->started_at?->toIso8601String() : null; $startedAtDisplay = $hasRunningTimer ? $activeTimer->started_at?->format('d M Y H:i') : null; @endphp

Ticket timer

Record focused work against this ticket.

@if ($hasRunningTimer)
Running
{{ gmdate('H:i:s', max(0, (int) $elapsedSeconds)) }}

Started {{ $startedAtDisplay }}

@endif
@if ($message)
{{ $message }}
@endif @error('timer')
{{ $message }}
@enderror

{{ $hasRunningTimer ? 'End the timer to add the elapsed time to the ticket.' : 'Start a timer when work begins. Only one active timer is allowed.' }}

@if ($hasRunningTimer) @else @endif