mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-11-18 03:50:36 -05:00
Closing time in local time for users without a time zone
Users without a time zone in their preferences fell back to UTC, so a 17:00 closing time stopped their timers hours early (e.g. at noon on a US Eastern server). Like Redmine (User#today), they now get the server's local time: for closing time, the Running timers page's "stopped at" field, and the "Timer stopped by" note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
82ffe7ed49
commit
9c937c6d6b
7 files changed
+41
-15
No files matched your search
@@ -45,8 +45,8 @@
|
||||
<% if row.started_at %>
|
||||
<%# Optional: when the person actually stopped working; blank = now %>
|
||||
<%= datetime_local_field_tag :stopped_at, nil,
|
||||
min: row.started_at.in_time_zone(User.current.time_zone || Time.zone).strftime('%Y-%m-%dT%H:%M'),
|
||||
max: Time.now.in_time_zone(User.current.time_zone || Time.zone).strftime('%Y-%m-%dT%H:%M'),
|
||||
min: User.current.convert_time_to_user_timezone(row.started_at).strftime('%Y-%m-%dT%H:%M'),
|
||||
max: User.current.convert_time_to_user_timezone(Time.now).strftime('%Y-%m-%dT%H:%M'),
|
||||
title: l(:text_stopwatch_stopped_at), 'aria-label': l(:label_stopwatch_stopped_at),
|
||||
id: "stopped_at_#{row.user.id}" %>
|
||||
<% end %>
|
||||
|
||||
Reference in new issue
Block a user