aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/PositionResource.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-01 19:11:22 +1300
committerGitHub <noreply@github.com>2016-11-01 19:11:22 +1300
commit7adac25c304b046ebfc59b1197663625e862cc81 (patch)
treee61c162edfe823f7f97226c097ac2173ccff3f96 /src/org/traccar/api/resource/PositionResource.java
parent12ddac1b181692a1e32a1a26e9189ab3091dd4bc (diff)
parentfdc61388a4f86bbd7fc7034fcf672486910eb58c (diff)
downloadtrackermap-server-7adac25c304b046ebfc59b1197663625e862cc81.tar.gz
trackermap-server-7adac25c304b046ebfc59b1197663625e862cc81.tar.bz2
trackermap-server-7adac25c304b046ebfc59b1197663625e862cc81.zip
Merge pull request #2502 from Abyss777/reports_jsonconverter
Remove explicit JSON conversion from reports
Diffstat (limited to 'src/org/traccar/api/resource/PositionResource.java')
-rw-r--r--src/org/traccar/api/resource/PositionResource.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/api/resource/PositionResource.java b/src/org/traccar/api/resource/PositionResource.java
index 488964f23..1ba126b62 100644
--- a/src/org/traccar/api/resource/PositionResource.java
+++ b/src/org/traccar/api/resource/PositionResource.java
@@ -17,10 +17,10 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.helper.DateUtil;
import org.traccar.model.Position;
import org.traccar.web.CsvBuilder;
import org.traccar.web.GpxBuilder;
-import org.traccar.web.JsonConverter;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -53,7 +53,7 @@ public class PositionResource extends BaseResource {
} else {
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
return Context.getDataManager().getPositions(
- deviceId, JsonConverter.parseDate(from), JsonConverter.parseDate(to));
+ deviceId, DateUtil.parseDate(from), DateUtil.parseDate(to));
}
}
@@ -66,7 +66,7 @@ public class PositionResource extends BaseResource {
CsvBuilder csv = new CsvBuilder();
csv.addHeaderLine(new Position());
csv.addArray(Context.getDataManager().getPositions(
- deviceId, JsonConverter.parseDate(from), JsonConverter.parseDate(to)));
+ deviceId, DateUtil.parseDate(from), DateUtil.parseDate(to)));
return Response.ok(csv.build()).header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_CSV).build();
}
@@ -78,7 +78,7 @@ public class PositionResource extends BaseResource {
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
GpxBuilder gpx = new GpxBuilder(Context.getIdentityManager().getDeviceById(deviceId).getName());
gpx.addPositions(Context.getDataManager().getPositions(
- deviceId, JsonConverter.parseDate(from), JsonConverter.parseDate(to)));
+ deviceId, DateUtil.parseDate(from), DateUtil.parseDate(to)));
return Response.ok(gpx.build()).header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_GPX).build();
}