mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-11-17 19: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
@@ -54,7 +54,8 @@ class RunningTimersTest < Redmine::IntegrationTest
|
||||
get '/stopwatch/running_timers'
|
||||
assert_select "tr#stopwatch-running-timer-#{@worker.id} form.stopwatch-stop-form"
|
||||
|
||||
left_at = (2.hours.ago).in_time_zone(Time.zone).strftime('%Y-%m-%dT%H:%M') # 1 hour after starting
|
||||
# jsmith has no time zone, so the field is in the server's local time
|
||||
left_at = 2.hours.ago.getlocal.strftime('%Y-%m-%dT%H:%M') # 1 hour after starting
|
||||
post "/stopwatch/running_timers/#{@worker.id}/stop", params: { stopped_at: left_at }
|
||||
assert_redirected_to '/stopwatch/running_timers'
|
||||
|
||||
|
||||
Reference in new issue
Block a user