1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Implement date grouping for MySQL (#13803).

Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@17745 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2018-12-16 07:03:47 +00:00
parent fee009f04f
commit 7386ec037e

View File

@ -74,6 +74,14 @@ module Redmine
else else
"#{column}::date" "#{column}::date"
end end
elsif mysql?
if time_zone
user_identifier = ActiveSupport::TimeZone.find_tzinfo(time_zone.name).identifier
local_identifier = ActiveSupport::TimeZone.find_tzinfo(Time.zone.name).identifier
"CONVERT_TZ(DATE(#{column}),'#{local_identifier}', '#{user_identifier}')"
else
"DATE(#{column})"
end
end end
end end