Skip to content

Group commits by date in server timezone

username-removed-443319 requested to merge 3870-commit-sorting-issue into master

Time#to_date just takes the (timezone-less) year, date, and month, and creates a new date from that. Because the commits in the list are grouped by date, rather than chunked when the date changes, a commit can be shown in the wrong order if its CommitDate has a timezone-less date that's different to other commits around it.

Convert all CommitDates to the server timezone before grouping, as that will at least produce consistent results. Users can still see a timestamp on the commit that doesn't match the date it's grouped under, because the timestamp shown uses the user's local timezone, and the grouping uses the server's timezone, but that was an issue anyway.

Before

image

After

image

Closes #3870 (closed) and closes #17300 (closed).

Merge request reports