aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-03 13:44:26 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-03 13:44:26 +1300
commita14db4167bfa4b7bff3a804a0724e7678fd5fe26 (patch)
tree887f234929ee7ef08d46d248d6f4d3bfe7e4401f
parent0a17447db65e188e8f21000a1e162eb0d73ef1eb (diff)
downloadtrackermap-server-a14db4167bfa4b7bff3a804a0724e7678fd5fe26.tar.gz
trackermap-server-a14db4167bfa4b7bff3a804a0724e7678fd5fe26.tar.bz2
trackermap-server-a14db4167bfa4b7bff3a804a0724e7678fd5fe26.zip
Another update for date serialization
-rw-r--r--src/org/traccar/api/ObjectMapperProvider.java7
-rw-r--r--web/app/model/Device.js2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/org/traccar/api/ObjectMapperProvider.java b/src/org/traccar/api/ObjectMapperProvider.java
index 5a9cbb9d9..b323a318b 100644
--- a/src/org/traccar/api/ObjectMapperProvider.java
+++ b/src/org/traccar/api/ObjectMapperProvider.java
@@ -16,6 +16,7 @@
package org.traccar.api;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
@@ -29,11 +30,7 @@ public class ObjectMapperProvider implements ContextResolver<ObjectMapper> {
private ObjectMapper mapper = new ObjectMapper();
public ObjectMapperProvider() {
- DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
- dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
-
- mapper.setConfig(mapper.getSerializationConfig().with(dateFormat));
- mapper.setConfig(mapper.getDeserializationConfig().with(dateFormat));
+ mapper.setConfig(mapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
}
@Override
diff --git a/web/app/model/Device.js b/web/app/model/Device.js
index 3cd9ee560..b8434d6ad 100644
--- a/web/app/model/Device.js
+++ b/web/app/model/Device.js
@@ -33,6 +33,6 @@ Ext.define('Traccar.model.Device', {
}, {
name: 'lastUpdate',
type: 'date',
- dateWriteFormat: 'C'
+ dateWriteFormat: 'c'
}]
});