chore: Timezone fixes for ReportBuilder and for ReportController spec (#4246)
- ReportBuilder wasn't using the specified time zone for the timestamp in the "build" method - The ReportController spec was calling `Time.zone.today.to_time`, but `Date#to_time` disregards the zone from `Time.zone` and reverts to the system time zone.
This commit is contained in:
@@ -19,7 +19,7 @@ class V2::ReportBuilder
|
||||
# For backward compatible with old report
|
||||
def build
|
||||
timeseries.each_with_object([]) do |p, arr|
|
||||
arr << { value: p[1], timestamp: p[0].to_time.to_i }
|
||||
arr << { value: p[1], timestamp: p[0].in_time_zone(@timezone).to_i }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user