fix(ui): store ScheduledFor as real UTC instead of mislabeled local time
The DB's global UtcConverter only tags DateTimes as Utc on read (SpecifyKind), it never converts on write. SetScheduledForAsync persisted the ThemedDatePicker's Local/Unspecified wall-clock value verbatim, so QueuePicker's comparison against DateTime.UtcNow fired scheduled tasks late by the local UTC offset (e.g. 2h in CEST). Convert to UTC at the write boundary, and ToLocalTime() at the read/compare sites (overdue checks in TaskRowViewModel/TasksIslandViewModel, the date-picker's edit seed) so existing scheduled/overdue display doesn't shift. Existing DB rows hold local wall-clock values mistagged as Utc; no migration added (few rows, one-time 2h-class shift accepted per the originating audit finding).
This commit is contained in:
@@ -217,7 +217,7 @@ public partial class TaskRowView : UserControl
|
||||
{
|
||||
if (DataContext is not TaskRowViewModel row) return;
|
||||
_pendingScheduleRow = row;
|
||||
ScheduleDate.SelectedDate = row.ScheduledFor ?? DateTime.Now.AddHours(1);
|
||||
ScheduleDate.SelectedDate = row.ScheduledFor?.ToLocalTime() ?? DateTime.Now.AddHours(1);
|
||||
ScheduleAnchor.Flyout?.ShowAt(ScheduleAnchor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user