File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,7 +140,9 @@ public bool CanSend(
140140 communication . State == ScheduledCommunicationState . Approved &&
141141 communication . ApprovedAt is not null &&
142142 communication . ScheduledFor <= now &&
143- ! quietHours . Contains ( TimeOnly . FromDateTime ( now . LocalDateTime ) ) ;
143+ // Quiet hours apply to the wall-clock time carried by the caller's
144+ // explicit offset, not to the timezone configured on this machine.
145+ ! quietHours . Contains ( TimeOnly . FromDateTime ( now . DateTime ) ) ;
144146 }
145147
146148 public ScheduledCommunication MarkSent (
Original file line number Diff line number Diff line change @@ -203,7 +203,10 @@ public WorkDaySummary Summarize(
203203 DateTimeOffset now )
204204 {
205205 WorkTimeEntry [ ] selected = entries
206- . Where ( entry => DateOnly . FromDateTime ( entry . StartedAt . LocalDateTime ) == date )
206+ // StartedAt.DateTime preserves the wall-clock date represented by the
207+ // entry's own offset. LocalDateTime would instead convert through the
208+ // machine timezone, making summaries differ between NZ and UTC runners.
209+ . Where ( entry => DateOnly . FromDateTime ( entry . StartedAt . DateTime ) == date )
207210 . ToArray ( ) ;
208211
209212 TimeSpan total = TimeSpan . FromTicks ( selected . Sum ( entry => entry . Duration ( now ) . Ticks ) ) ;
You can’t perform that action at this time.
0 commit comments