Fix Timezone Inconsistencies in User Contribution Calendar
This MR fixes two annoying bugs in the user profile contribution calendar.
-
Frontend: The visible squares of the calendar graph rendered in the browser assumed the local time of the browser rather than that of the gitlab server. This meant that if you were located in US Pacific Daylight Time (UTC-7), and you performed an activity after 5pm, you would not see it represented in your calendar until after midnight because that square would not exist.
-
Backend: The calendar data queried from the database was grouped by UTC date, irrespective of the Rails app
time_zone
setting. If you wanted to run your GitLab instance in Sydney, you'd have to deal with activity graphs that reflect contribution dates in UTC+0 time making it confusing to look at. Contributions made on a Monday would often look like they were made on Sunday if you contributed during normal business hours.
Screenshots
Sydney - AEST (UTC+10)
gitlab:
time_zone: 'Sydney'
UTC-6)
Chicago - CST ( gitlab:
time_zone: 'Central Time (US & Canada)'
Closes #27616 (closed), #1943 (closed)