From d1f8eb5bbc8f4779d23f23e43b1326e00e3c9131 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 20 Oct 2017 16:13:47 +0200 Subject: [PATCH] SONAR-10008 update boundaries in creation date facet --- .../main/js/apps/issues/sidebar/CreationDateFacet.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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] -- 2.39.5