From 7ad313a4b0509d37fe5d8dfa215ab980c8c74ed0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 12 Jul 2016 15:22:50 +0300 Subject: fix date serializing with tests --- juick-core/src/main/java/com/juick/json/MessageSerializer.java | 6 +++++- .../src/main/java/com/juick/xmpp/extensions/JuickMessage.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'juick-core') diff --git a/juick-core/src/main/java/com/juick/json/MessageSerializer.java b/juick-core/src/main/java/com/juick/json/MessageSerializer.java index e8402d51..4238df60 100644 --- a/juick-core/src/main/java/com/juick/json/MessageSerializer.java +++ b/juick-core/src/main/java/com/juick/json/MessageSerializer.java @@ -39,7 +39,7 @@ public class MessageSerializer extends JSONSerializer { UserSerializer userSerializer = new UserSerializer(); PlaceSerializer placeSerializer = new PlaceSerializer(); - final SimpleDateFormat df; + private final SimpleDateFormat df; public MessageSerializer() { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -135,4 +135,8 @@ public class MessageSerializer extends JSONSerializer { return json; } + + public SimpleDateFormat getDf() { + return df; + } } diff --git a/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java b/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java index 885b2375..510f7cc1 100644 --- a/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java +++ b/juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java @@ -81,7 +81,7 @@ public class JuickMessage extends com.juick.Message implements StanzaChild { if (sReadOnly != null) { jmsg.ReadOnly = true; } - String ts = parser.getAttributeValue(null, "timestamp"); + String ts = parser.getAttributeValue(null, "ts"); if (ts != null) { jmsg.setDate(df.parse(ts)); } -- cgit v1.2.3