Use correct time to get formatted time.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 12 Sep 2011 12:50:01 +0000 (14:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 12 Sep 2011 12:54:38 +0000 (14:54 +0200)
src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java

index 31ec399..f03e6e4 100644 (file)
@@ -52,7 +52,6 @@ public class GetTimesAjaxPage extends JsonPage {
         */
        @Override
        protected JsonObject createJsonObject(Request request) {
-               long now = System.currentTimeMillis();
                String allIds = request.getHttpRequest().getParam("posts");
                JsonObject postTimes = new JsonObject();
                if (allIds.length() > 0) {
@@ -79,9 +78,8 @@ public class GetTimesAjaxPage extends JsonPage {
                                if (reply == null) {
                                        continue;
                                }
-                               long age = now - reply.getTime();
                                JsonObject replyTime = new JsonObject();
-                               Time time = getTime(age);
+                               Time time = getTime(reply.getTime());
                                replyTime.put("timeText", time.getText());
                                replyTime.put("refreshTime", time.getRefresh() / Time.SECOND);
                                replyTime.put("tooltip", dateFormat.format(new Date(reply.getTime())));