Skip to content

Always show UTC dates for iteration start/due dates

Simon Knox requested to merge 227286-wrong-dates-when-saving-an-iteration into master

What does this MR do?

Iteration start/due dates don't have a time - they are just a date string yyyy-mm-dd. This meant users with subzero timezones (e.g. US Pacific time) got a timezone-adjusted date showing the previous day.

This adds the utc parameter and passes it from places in Iterations.

How to test

For dev, requires the group_iterations feature flag, an iteration created, and local timezone set to less than UTC

bin/rspec ee/spec/features/groups/iterations/user_views_iteration_spec.rb

diff --git a/ee/spec/features/groups/iterations/user_views_iteration_spec.rb b/ee/spec/features/groups/iterations/user_views_iteration_spec.rb
index d92ff13b15f..9b834e23eaf 100644
--- a/ee/spec/features/groups/iterations/user_views_iteration_spec.rb
+++ b/ee/spec/features/groups/iterations/user_views_iteration_spec.rb
@@ -18,6 +18,7 @@ RSpec.describe 'User views iteration' do
       end
 
       it 'shows iteration info and dates' do
+        live_debug
         expect(page).to have_content(iteration.title)
         expect(page).to have_content(iteration.description)
         expect(page).to have_content(iteration.start_date.strftime('%b %-d, %Y'))

Screenshots

  1. Set system timezone to somewhere on the western half of the world
  2. Load iteration
  3. Compare date in graphql response with displayed date

Screen_Shot_2020-07-10_at_12.04.38_am

Does this MR meet the acceptance criteria?

Closes #227286 (closed)

Edited by Simon Knox

Merge request reports