|
|
@ -75,11 +75,7 @@ module ApplicationHelper |
|
|
|
return nil unless time |
|
|
|
return nil unless time |
|
|
|
time = time.to_time if time.is_a?(String) |
|
|
|
time = time.to_time if time.is_a?(String) |
|
|
|
zone = User.current.time_zone |
|
|
|
zone = User.current.time_zone |
|
|
|
if time.utc? |
|
|
|
local = zone ? time.in_time_zone(zone) : (time.utc? ? time.utc_to_local : time) |
|
|
|
local = zone ? zone.adjust(time) : time.getlocal |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
local = zone ? zone.adjust(time.getutc) : time |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
@date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format) |
|
|
|
@date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format) |
|
|
|
@time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format) |
|
|
|
@time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format) |
|
|
|
include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format) |
|
|
|
include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format) |
|
|
|