]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2074 Fix bug that occurs when several snapshots on the same day
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 09:08:38 +0000 (11:08 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 09:08:38 +0000 (11:08 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb

index 88c1d07cdb58aa71f2b2f3a18c4d6c80a93f7266..5bdb2b17c57fc2b7c086bc85e807a006d5a2b24b 100644 (file)
         js_data += (m_date.month - 1).to_s
         js_data += ","
         js_data += m_date.day.to_s
+        js_data += ","
+        js_data += m_date.hour.to_s
+        js_data += ","
+        js_data += m_date.min.to_s
+        js_data += ","
+        js_data += m_date.sec.to_s
         js_data += "),\"y\":" 
         js_data += sprintf( "%0.02f", metric_data[:value])
         js_data +=  "},"
@@ -53,7 +59,7 @@
           js_snapshots += "{\"sid\":"
           js_snapshots += metric_data[:sid]
           js_snapshots += ",\"d\":\""
-          js_snapshots += human_short_date(m_date)
+          js_snapshots += l m_date, :format => :long
           js_snapshots += "\"},"
         end
       end
       js_events += (e_date.month - 1).to_s
       js_events += ","
       js_events += e_date.day.to_s
+      js_events += ","
+      js_events += e_date.hour.to_s
+      js_events += ","
+      js_events += e_date.min.to_s
+      js_events += ","
+      js_events += e_date.sec.to_s
       js_events += "),\"l\":["
       e_details.each() do |e|
         js_events += "{\"n\":\""
         js_events += e.name
         js_events +=  "\",\"ld\":\""
-        js_events += human_short_date(e_date)
+        js_events += l e_date, :format => :long
         js_events += "\"},"
       end 
       js_events += "]},"
 
        <div id="timeline-chart-<%= widget.id -%>"></div>
        <script type="text/javascript+protovis">
-         function d(y,m,d) {
-           return new Date(y,m,d);
+         function d(y,m,d,h,min,s) {
+           return new Date(y,m,d,h,min,s);
          }
          var data = <%= js_data -%>;
          var snapshots = <%= js_snapshots -%>;