diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/gitblit/models/IssueModel.java | 7 | ||||
-rw-r--r-- | src/com/gitblit/utils/JsonUtils.java | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/com/gitblit/models/IssueModel.java b/src/com/gitblit/models/IssueModel.java index 246b29bf..3c191e24 100644 --- a/src/com/gitblit/models/IssueModel.java +++ b/src/com/gitblit/models/IssueModel.java @@ -59,7 +59,8 @@ public class IssueModel implements Serializable, Comparable<IssueModel> { 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 class IssueModel implements Serializable, Comparable<IssueModel> { }
public void applyChange(Change change) {
+ if (changes.size() == 0) {
+ // first change created the issue
+ created = change.created;
+ }
changes.add(change);
if (change.hasFieldChanges()) {
diff --git a/src/com/gitblit/utils/JsonUtils.java b/src/com/gitblit/utils/JsonUtils.java index aea46bbb..bc9a1e00 100644 --- a/src/com/gitblit/utils/JsonUtils.java +++ b/src/com/gitblit/utils/JsonUtils.java @@ -295,7 +295,8 @@ public class JsonUtils { JsonDeserializationContext jsonDeserializationContext) {
try {
synchronized (dateFormat) {
- return dateFormat.parse(jsonElement.getAsString());
+ Date date = dateFormat.parse(jsonElement.getAsString());
+ return new Date((date.getTime() / 1000) * 1000);
}
} catch (ParseException e) {
throw new JsonSyntaxException(jsonElement.getAsString(), e);
|