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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user