James Moger
2012-02-17 35a71b925779d7c6c8f861f1b31b16a0d197b206
Fixed date bugs on IssueModel
2 files modified
10 ■■■■ changed files
src/com/gitblit/models/IssueModel.java 7 ●●●● patch | view | raw | blame | history
src/com/gitblit/utils/JsonUtils.java 3 ●●●● patch | view | raw | blame | history
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()) {
src/com/gitblit/utils/JsonUtils.java
@@ -295,7 +295,8 @@
                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);