From ac9fbc286812077feb8a5207448a011727843b80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 21 Oct 2010 14:12:19 +0200 Subject: [PATCH] Return date of last update in JSON object. --- src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java index 7a4bfda..e5385fa 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java @@ -17,6 +17,9 @@ package net.pterodactylus.sone.web.ajax; +import java.text.SimpleDateFormat; +import java.util.Date; + import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.Core.SoneStatus; import net.pterodactylus.sone.data.Sone; @@ -52,7 +55,7 @@ public class GetSoneStatusPage extends JsonPage { String soneId = request.getHttpRequest().getParam("sone"); Sone sone = core.getSone(soneId); SoneStatus soneStatus = core.getSoneStatus(sone); - return new JsonObject().put("status", soneStatus.name()).put("modified", sone.getModificationCounter() > 0); + return new JsonObject().put("status", soneStatus.name()).put("modified", sone.getModificationCounter() > 0).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))); } } -- 2.7.4