fix: store opened_at and closed_at as DATETIME (not DATE)

DATE columns lose time information, causing timeline to show 00:00 for
car reception and WO closure. Migrated both columns to DATETIME and
updated: model casts (date → datetime), form pickers (DatePicker →
DateTimePicker with seconds:false), default to now() instead of today(),
and cleaned up defensive Carbon::parse() in getTimeline().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-11 04:52:03 +00:00
parent ce9f082612
commit 5a3275c2cf
4 changed files with 29 additions and 6 deletions
@@ -122,7 +122,7 @@ class WorkOrderDashboard extends Page
'icon' => '📋',
];
}
if ($wo->opened_at && $wo->opened_at->ne($wo->created_at)) {
if ($wo->opened_at && $wo->opened_at->format('Y-m-d H:i') !== $wo->created_at?->format('Y-m-d H:i')) {
$events[] = [
'at' => $wo->opened_at,
'kind' => 'opened',
@@ -142,7 +142,7 @@ class WorkOrderDashboard extends Page
}
if ($wo->closed_at) {
$events[] = [
'at' => $wo->closed_at instanceof \Carbon\Carbon ? $wo->closed_at : \Carbon\Carbon::parse($wo->closed_at),
'at' => $wo->closed_at,
'kind' => 'closed',
'label' => __('Fișă închisă'),
'meta' => null,