]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5664 Component Viewer doesn't work properly in the differential mode in Safari
authorStas Vilchik <vilchiks@gmail.com>
Tue, 7 Oct 2014 14:17:10 +0000 (16:17 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 7 Oct 2014 14:17:10 +0000 (16:17 +0200)
server/sonar-web/src/main/coffee/component-viewer/main.coffee
server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee

index 9f65306e531b771c660c8d3d2519670610cd07cd..15e2a13d138a8dc28523e15e437de702a465d5b1 100644 (file)
@@ -185,9 +185,9 @@ define [
           # Periods
           @periods.reset [{label: t('none')}]
           data.periods.forEach (p) =>
-            d = new Date p[2]
-            d.setHours 0, 0, 0, 0
-            p = @periods.add key: p[0], label: p[1], sinceDate: d
+            d = moment p[2]
+            date = new Date d.get('year'), d.get('month'), d.get('date')
+            p = @periods.add key: p[0], label: p[1], sinceDate: date
 
 
     requestMeasures: (key, period = null) ->
index 477420b5d29990750cb8e991e1021b7ac5a6ab72..5c3d522595a38bef4ac8e3ea874f6927882adf5e 100644 (file)
@@ -84,7 +84,8 @@ define [
       if period
         p = predicate
         predicate = (issue) =>
-          (new Date(issue.creationDate) >= period.get('sinceDate')) && p issue
+          creationDate = new Date moment(issue.creationDate).format()
+          (creationDate >= period.get('sinceDate')) && p issue
 
       if requestIssues && !@state.get 'hasIssues'
         @requestIssues(@key).done => @_filterByIssues(predicate)