From: Stas Vilchik Date: Fri, 20 Oct 2017 14:13:47 +0000 (+0200) Subject: SONAR-10008 update boundaries in creation date facet X-Git-Tag: 6.7-RC1~33 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d1f8eb5bbc8f4779d23f23e43b1326e00e3c9131;p=sonarqube.git SONAR-10008 update boundaries in creation date facet --- diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js index c897fb9ac49..2f4e5038b86 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.js @@ -161,15 +161,14 @@ export default class CreationDateFacet extends React.PureComponent { } const { formatDate } = this.context.intl; - const beforeDate = createdBefore ? createdBefore : undefined; const data = periods.map((start, index) => { const startDate = parseDate(start); - let nextStartDate = index < periods.length - 1 ? periods[index + 1] : beforeDate; let endDate; - if (nextStartDate) { - nextStartDate = parseDate(nextStartDate); - endDate = parseDate(nextStartDate); + if (index < periods.length - 1) { + endDate = parseDate(periods[index + 1]); endDate.setDate(endDate.getDate() - 1); + } else { + endDate = createdBefore && parseDate(createdBefore); } let tooltip = @@ -182,7 +181,7 @@ export default class CreationDateFacet extends React.PureComponent { return { createdAfter: startDate, - createdBefore: nextStartDate, + createdBefore: endDate, tooltip, x: index, y: stats[start]