mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Joda-Time for ISO6801 timestamps.
This commit is contained in:
parent
e7c1b29008
commit
83db4e6a10
4 changed files with 22 additions and 14 deletions
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: joda-time:joda-time:2.7">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/joda-time/joda-time/2.7/joda-time-2.7-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -97,6 +97,11 @@
|
|||
<artifactId>slf4j-nop</artifactId>
|
||||
<version>1.7.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,5 +1,6 @@
|
|||
package uk.ac.ic.wlgitbridge.writelatex.model;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import uk.ac.ic.wlgitbridge.util.Util;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotAttachment;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotData;
|
||||
|
@ -7,8 +8,6 @@ import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile;
|
|||
import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.WLUser;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -31,16 +30,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
|||
WLUser user = info.getUser();
|
||||
userName = user.getName();
|
||||
userEmail = user.getEmail();
|
||||
TimeZone tz = TimeZone.getDefault();
|
||||
Calendar cal = Calendar.getInstance(tz);
|
||||
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 e2) {
|
||||
throw new RuntimeException(e2);
|
||||
}
|
||||
createdAt = cal.getTime();
|
||||
createdAt = new DateTime(info.getCreatedAt()).toDate();
|
||||
|
||||
srcs = data.getSrcs();
|
||||
atts = data.getAtts();
|
||||
|
|
|
@ -43,6 +43,6 @@
|
|||
<orderEntry type="library" name="Maven: org.eclipse.jgit:org.eclipse.jgit.http.server:3.6.0.201412230720-r" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.8.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-nop:1.7.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: joda-time:joda-time:2.7" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
|
Loading…
Reference in a new issue