diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-27 20:53:59 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-27 20:53:59 +1300 |
commit | 3185c02ebfbe55c867aa514d9f47a867e18a1593 (patch) | |
tree | d906fc15940bba5ab60c6f5b1943137f6fef6af4 /src/org/traccar/web/client | |
parent | 56c396b939ece1927fca536dc2379ebd66c7f1ef (diff) | |
download | trackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.tar.gz trackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.tar.bz2 trackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.zip |
Round period to next 15 min
Diffstat (limited to 'src/org/traccar/web/client')
-rw-r--r-- | src/org/traccar/web/client/view/ArchiveView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/web/client/view/ArchiveView.java b/src/org/traccar/web/client/view/ArchiveView.java index 28291d0d..9cc579f8 100644 --- a/src/org/traccar/web/client/view/ArchiveView.java +++ b/src/org/traccar/web/client/view/ArchiveView.java @@ -132,12 +132,14 @@ public class ArchiveView implements SelectionChangedEvent.SelectionChangedHandle grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); // Initialize with current time + long min = 60 * 1000; Date now = new Date(); - Date from = new Date(now.getTime() - 60 * 60 * 1000); + Date to = new Date(((now.getTime() + 15 * min) / (15 * min)) * 15 * min); + Date from = new Date(to.getTime() - 60 * min); fromDate.setValue(from); fromTime.setValue(from); - toDate.setValue(now); - toTime.setValue(now); + toDate.setValue(to); + toTime.setValue(to); } @Override |