summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
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