fix: Replace unsafe date formatting in SchedulesView with safeDate()
All checks were successful
Test Asgard Runner / test (push) Successful in 3s

Replace `new Date(x).toLocaleString()` pattern with `safeDate()` utility to prevent crashes on null/undefined timestamps in scheduled task next_run field.

Part of ongoing safe formatter migration across all Vue views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-15 21:57:07 -05:00
parent 26e717ac96
commit 05315cc88a

View File

@@ -2,6 +2,7 @@
import { ref, onMounted } from 'vue'
import { useApi } from '@/composables/useApi'
import { Clock, Plus, Edit, Trash2, Power, Loader2 } from 'lucide-vue-next'
import { safeDate } from '@/utils/formatters'
interface ScheduledTask {
id: string
@@ -142,7 +143,7 @@ onMounted(() => {
<td class="px-4 py-3 text-sm text-neutral-400 capitalize">{{ task.task_type.replace('_', ' ') }}</td>
<td class="px-4 py-3 text-sm font-mono text-neutral-400">{{ task.cron_expression }}</td>
<td class="px-4 py-3 text-sm text-neutral-400">{{ task.timezone }}</td>
<td class="px-4 py-3 text-sm text-neutral-400">{{ task.next_run ? new Date(task.next_run).toLocaleString() : '—' }}</td>
<td class="px-4 py-3 text-sm text-neutral-400">{{ safeDate(task.next_run, '—') }}</td>
<td class="px-4 py-3">
<span
class="text-xs font-medium px-2 py-0.5 rounded-full"