From 073b11b1e33c2c52a0796b75920b588c937eb6e9 Mon Sep 17 00:00:00 2001
From: John Crygier <john.crygier@aon.com>
Date: Tue, 10 Apr 2012 14:50:51 -0400
Subject: [PATCH] Documentation for LDAP.  Covers the setup case that is in the JUnit Integration Test.

---
 src/com/gitblit/models/IssueModel.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/com/gitblit/models/IssueModel.java b/src/com/gitblit/models/IssueModel.java
index 246b29b..3c191e2 100644
--- a/src/com/gitblit/models/IssueModel.java
+++ b/src/com/gitblit/models/IssueModel.java
@@ -59,7 +59,8 @@
 	public List<Change> changes;
 
 	public IssueModel() {
-		created = new Date((System.currentTimeMillis() / 1000) * 1000);
+		// the first applied change set the date appropriately
+		created = new Date(0);
 
 		type = Type.Defect;
 		status = Status.New;
@@ -117,6 +118,10 @@
 	}
 
 	public void applyChange(Change change) {
+		if (changes.size() == 0) {
+			// first change created the issue
+			created = change.created;
+		}
 		changes.add(change);
 
 		if (change.hasFieldChanges()) {

--
Gitblit v1.9.1