Fixed bug: ExcelSheet timezone conversion doesn't take DST into account.
This commit is contained in:
parent
d2912ff25f
commit
f17c181427
1 changed files with 1 additions and 2 deletions
|
@ -5,7 +5,6 @@ class ExcelSheet
|
|||
@header = header
|
||||
@records = records
|
||||
@timezone = timezone.presence || Setting.get('timezone_default')
|
||||
@timezone_offset = @timezone.present? ? Time.now.in_time_zone(@timezone).utc_offset : 0
|
||||
@locale = locale || 'en-en'
|
||||
@tempfile = Tempfile.new('excel-export.xls')
|
||||
@workbook = WriteExcel.new(@tempfile)
|
||||
|
@ -113,7 +112,7 @@ class ExcelSheet
|
|||
def timestamp_in_localtime(time)
|
||||
return if time.blank?
|
||||
|
||||
(time + @timezone_offset).utc.strftime('%F %T') # "2019-08-19 16:21:52"
|
||||
time.in_time_zone(@timezone).strftime('%F %T') # "2019-08-19 16:21:52"
|
||||
end
|
||||
|
||||
def value_lookup(record, attribute, additional)
|
||||
|
|
Loading…
Reference in a new issue