]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5183 - timezones - fix timemachine widget on oracle 77/head
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 9 Feb 2015 15:46:19 +0000 (16:46 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 9 Feb 2015 15:47:18 +0000 (16:47 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb

index 200a48fd8a7bf1a816423d610e3d4440ada4f856..18c5d7785a2edff1a39b4a818dded2a9ba729afa 100644 (file)
@@ -38,7 +38,7 @@
        else
          metric_count_per_snapshot_id[sid] = 1
        end
-       metric_data_map[trend_item["metric_id"].to_i] << {:date => trend_item["created_at"], :value => trend_item["value"], :sid => trend_item["sid"]}
+       metric_data_map[trend_item["metric_id"].to_i] << {:date => Time.at(trend_item["created_at"].to_i/1000), :value => trend_item["value"], :sid => trend_item["sid"]}
      end
 
      # Create JS structures to print out in the HTML page
@@ -53,7 +53,7 @@
          metric_data_map[metric_id].each() do |metric_data|
            # for every metric value, we need to check that the corresponding snapshot has values for each metric
            if metric_count_per_snapshot_id[metric_data[:sid]]==total_number_of_metrics
-             m_date = Time.at(metric_data[:date]/1000)
+             m_date = metric_data[:date]
              m_value = sprintf("%0.02f", metric_data[:value])
              m_value_localized = ProjectMeasure.new(:metric => metric_map[metric_id]).format_numeric_value(metric_data[:value], {})
              js_data += "{x:d("
@@ -97,7 +97,7 @@
        unless from_date
          # find the oldest date
          metric_data_map.values.each() do |metric_data_array|
-           first_date = Time.at(metric_data_array[0][:date]/1000)
+           first_date = metric_data_array[0][:date]
            from_date = first_date if !from_date || from_date > first_date
          end
        end