diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-05-17 17:32:36 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-05-17 17:32:36 +0200 |
commit | 2f6ac87ae99bb3601d4d6f4bb85a9d4b1b3a94df (patch) | |
tree | 4f42ffb4603e7a4c6810ac2cbb27eb02c5ad0548 | |
parent | 914ce5b41428aaea63ce66ac724ba13958fc1cf1 (diff) | |
download | sonarqube-2f6ac87ae99bb3601d4d6f4bb85a9d4b1b3a94df.tar.gz sonarqube-2f6ac87ae99bb3601d4d6f4bb85a9d4b1b3a94df.zip |
SONAR-7637 WS api/issues/search fix timezone related issues on createdAt facet
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java index e5f0e19578a..b43203c12f1 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; +import java.util.TimeZone; import java.util.regex.Pattern; import javax.annotation.CheckForNull; import javax.annotation.Nullable; @@ -127,9 +128,7 @@ public class IssueIndex extends BaseIndex { LANGUAGES, TAGS, TYPES, - CREATED_AT - ); - + CREATED_AT); // TODO to be documented // TODO move to Facets ? @@ -461,6 +460,7 @@ public class IssueIndex extends BaseIndex { long now = system.now(); String timeZoneString = system.getDefaultTimeZone().getID(); + String gmtTimeZoneString = TimeZone.getTimeZone("GMT").getID(); DateHistogram.Interval bucketSize = DateHistogram.Interval.YEAR; Date createdAfter = query.createdAfter(); @@ -483,7 +483,7 @@ public class IssueIndex extends BaseIndex { .interval(bucketSize) .minDocCount(0L) .format(DateUtils.DATETIME_FORMAT) - .timeZone(timeZoneString) + .timeZone(gmtTimeZoneString) .postZone(timeZoneString) .extendedBounds(startTime, endTime); dateHistogram = addEffortAggregationIfNeeded(query, dateHistogram); |