summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2020-04-05 11:20:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2020-04-05 11:20:58 +0000
commitae82276290201509fe015d7482c67065e1885ca2 (patch)
treeb888f5a863e5b3cd10182125f24147c48e544127 /app/models/query.rb
parentd1360a67ab6a0909ed5d4164bcc7c403828ac2ed (diff)
downloadredmine-ae82276290201509fe015d7482c67065e1885ca2.tar.gz
redmine-ae82276290201509fe015d7482c67065e1885ca2.zip
Merged r19655 to 4.1-stable (#33110).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19665 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 36c938820..0dec7d211 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -842,7 +842,12 @@ class Query < ActiveRecord::Base
def group_by_sort_order
if column = group_by_column
order = (sort_criteria.order_for(column.name) || column.default_order || 'asc').try(:upcase)
- Array(column.sortable).map {|s| Arel.sql("#{s} #{order}")}
+
+ column_sortable = column.sortable
+ if column.is_a?(TimestampQueryColumn)
+ column_sortable = Redmine::Database.timestamp_to_date(column.sortable, User.current.time_zone)
+ end
+ Array(column_sortable).map {|s| Arel.sql("#{s} #{order}")}
end
end