aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-27 20:53:59 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-27 20:53:59 +1300
commit3185c02ebfbe55c867aa514d9f47a867e18a1593 (patch)
treed906fc15940bba5ab60c6f5b1943137f6fef6af4 /src/org
parent56c396b939ece1927fca536dc2379ebd66c7f1ef (diff)
downloadtrackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.tar.gz
trackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.tar.bz2
trackermap-web-3185c02ebfbe55c867aa514d9f47a867e18a1593.zip
Round period to next 15 min
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/web/client/view/ArchiveView.java8
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