From 64995e8b621b9b56f74dcbb97c353a8db98c6ef4 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 7 Oct 2014 16:17:10 +0200 Subject: [PATCH] SONAR-5664 Component Viewer doesn't work properly in the differential mode in Safari --- .../sonar-web/src/main/coffee/component-viewer/main.coffee | 6 +++--- .../main/coffee/component-viewer/mixins/main-issues.coffee | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/coffee/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/component-viewer/main.coffee index 9f65306e531..15e2a13d138 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/main.coffee @@ -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) -> diff --git a/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee b/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee index 477420b5d29..5c3d522595a 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/mixins/main-issues.coffee @@ -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) -- 2.39.5