Round date intervals to nearest hour
start_date, stop_date and end will be rounded to the nearest hour, in order to help cache hits. Change-Id: I441e8ded715a727362a44f14c24571a37217e0d7
This commit is contained in:
parent
e2817570dc
commit
0530b663d1
|
@ -24,7 +24,10 @@ var viewService = function($rootScope, $location) {
|
|||
}
|
||||
});
|
||||
|
||||
var periodEnd = new Date();
|
||||
var periodEnd = moment()
|
||||
.startOf('hour')
|
||||
.add(1,'hours')
|
||||
.toDate();
|
||||
var periodOptions = [
|
||||
moment.duration({ hours: 1 }),
|
||||
moment.duration({ hours: 12 }),
|
||||
|
@ -117,8 +120,9 @@ var viewService = function($rootScope, $location) {
|
|||
|
||||
periodStart: function() {
|
||||
return moment(periodEnd)
|
||||
.subtract(selectDuration())
|
||||
.toDate();
|
||||
.startOf('hour')
|
||||
.subtract(selectDuration())
|
||||
.toDate();
|
||||
},
|
||||
|
||||
periodOptions: function() {
|
||||
|
|
Loading…
Reference in New Issue