aboutsummaryrefslogtreecommitdiff
path: root/juick-core/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-12 15:22:50 +0300
committerGravatar Vitaly Takmazov2016-07-12 15:22:50 +0300
commit7ad313a4b0509d37fe5d8dfa215ab980c8c74ed0 (patch)
treecb477b0918a66ef59915ea85a38a4d162d36e51b /juick-core/src/main
parent47ec7ca54927d586fe5c5dca3be377231cb59c11 (diff)
fix date serializing with tests
Diffstat (limited to 'juick-core/src/main')
-rw-r--r--juick-core/src/main/java/com/juick/json/MessageSerializer.java6
-rw-r--r--juick-core/src/main/java/com/juick/xmpp/extensions/JuickMessage.java2
2 files changed, 6 insertions, 2 deletions
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<Message> {
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<Message> {
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));
}