Change timestamp parsing to include milliseconds.

This commit is contained in:
Winston Li 2015-03-09 21:29:03 +00:00
parent e6bdbe8f17
commit e7c1b29008
8 changed files with 30 additions and 30 deletions

View file

@ -85,7 +85,7 @@ public class SnapshotGetDocResult extends Result {
email = userObject.get("email").getAsString();
} else {
name = "Anonymous";
email = "anonymous@writelatex.com";
email = "anonymous@overleaf.com";
}
}
}

View file

@ -33,12 +33,12 @@ public class Snapshot implements Comparable<Snapshot> {
userEmail = user.getEmail();
TimeZone tz = TimeZone.getDefault();
Calendar cal = Calendar.getInstance(tz);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
sdf.setCalendar(cal);
try {
cal.setTime(sdf.parse(info.getCreatedAt()));
} catch (ParseException e) {
throw new RuntimeException(e);
} catch (ParseException e2) {
throw new RuntimeException(e2);
}
createdAt = cal.getTime();

View file

@ -3,7 +3,7 @@
"project": "testproj",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -13,7 +13,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.333Z"
}
],
"getForVers": [

View file

@ -3,7 +3,7 @@
"project": "testproj1",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -13,7 +13,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [
@ -47,7 +47,7 @@
"project": "testproj2",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -57,7 +57,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [

View file

@ -3,7 +3,7 @@
"project": "testproj",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -13,7 +13,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [

View file

@ -3,7 +3,7 @@
"project": "testproj",
"getDoc": {
"versionID": 2,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -13,14 +13,14 @@
"comment": "i deleted test.tex",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:48:01Z"
"createdAt": "2014-11-30T18:48:01.123Z"
},
{
"versionID": 1,
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [

View file

@ -4,7 +4,7 @@
"getDoc": {
"error": 403,
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -14,7 +14,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [
@ -42,7 +42,7 @@
"project": "invalidFiles",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -52,7 +52,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [
@ -95,7 +95,7 @@
"project": "invalidProject",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -136,7 +136,7 @@
"project": "error",
"getDoc": {
"versionID": 1,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -146,7 +146,7 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
}
],
"getForVers": [

View file

@ -3,7 +3,7 @@
"project": "1826rqgsdb",
"getDoc": {
"versionID": 243,
"createdAt": "2014-11-30T18:40:58Z",
"createdAt": "2014-11-30T18:40:58.123Z",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1"
},
@ -13,49 +13,49 @@
"comment": "added more info on doc GET and error details",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-30T18:47:01Z"
"createdAt": "2014-11-30T18:47:01.456Z"
},
{
"versionID": 185,
"comment": "with more details on POST request",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-11T17:18:40Z"
"createdAt": "2014-11-11T17:18:40.789Z"
},
{
"versionID": 175,
"comment": "with updated PUT/POST request",
"email": "jdleesmiller+1@gmail.com",
"name": "John+1",
"createdAt": "2014-11-09T23:09:13Z"
"createdAt": "2014-11-09T23:09:13.123Z"
},
{
"versionID": 146,
"comment": "added PUT format",
"email": "jdleesmiller@gmail.com",
"name": "John Lees-Miller",
"createdAt": "2014-11-07T15:11:35Z"
"createdAt": "2014-11-07T15:11:35.456Z"
},
{
"versionID": 74,
"comment": "with example output",
"email": "jdleesmiller@gmail.com",
"name": "John Lees-Miller",
"createdAt": "2014-11-05T18:09:41Z"
"createdAt": "2014-11-05T18:09:41.789Z"
},
{
"versionID": 39,
"comment": "with more files",
"email": "jdleesmiller@gmail.com",
"name": "John Lees-Miller",
"createdAt": "2014-11-05T18:02:19Z"
"createdAt": "2014-11-05T18:02:19.123Z"
},
{
"versionID": 24,
"comment": "first draft",
"email": "jdleesmiller@gmail.com",
"name": "John Lees-Miller",
"createdAt": "2014-11-05T17:56:58Z"
"createdAt": "2014-11-05T17:56:58.456Z"
}
],
"getForVers": [