summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/ActivityUtils.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-02-25 08:18:22 -0500
committerJames Moger <james.moger@gitblit.com>2012-02-25 08:18:22 -0500
commit40538c57dd574d831d044cda50a8999941dc0a24 (patch)
tree07ab800693cfef9c81dcc295146349fe5c869d6f /src/com/gitblit/utils/ActivityUtils.java
parent9d921f83d48fff71762bb4a579870107c788ecf9 (diff)
downloadgitblit-40538c57dd574d831d044cda50a8999941dc0a24.tar.gz
gitblit-40538c57dd574d831d044cda50a8999941dc0a24.zip
Use proper timezone to generate all metrics
Diffstat (limited to 'src/com/gitblit/utils/ActivityUtils.java')
-rw-r--r--src/com/gitblit/utils/ActivityUtils.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/gitblit/utils/ActivityUtils.java b/src/com/gitblit/utils/ActivityUtils.java
index 61b6242a..d603a490 100644
--- a/src/com/gitblit/utils/ActivityUtils.java
+++ b/src/com/gitblit/utils/ActivityUtils.java
@@ -27,6 +27,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.TimeZone;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -60,10 +61,12 @@ public class ActivityUtils {
* @param objectId
* the branch to retrieve. If this value is null or empty all
* branches are queried.
+ * @param timezone
+ * the timezone for aggregating commits
* @return
*/
public static List<Activity> getRecentActivity(List<RepositoryModel> models, int daysBack,
- String objectId) {
+ String objectId, TimeZone timezone) {
// Activity panel shows last daysBack of activity across all
// repositories.
@@ -72,9 +75,9 @@ public class ActivityUtils {
// Build a map of DailyActivity from the available repositories for the
// specified threshold date.
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
- df.setTimeZone(GitBlit.getTimezone());
+ df.setTimeZone(timezone);
Calendar cal = Calendar.getInstance();
- cal.setTimeZone(GitBlit.getTimezone());
+ cal.setTimeZone(timezone);
Map<String, Activity> activity = new HashMap<String, Activity>();
for (RepositoryModel model : models) {