Added time filter to query search page (#1329)

* Added time filter to query search page

* Added start date

* Updated python endpoint test

* changed spec

* Added specs and tests

* Modified python/js tests and some function/file names
based on code review comments

* Resolved conflicts in DashboardSelect_spec and QuerySearch_spec

* Break python tests for separate functions, Move sql queries to setUp()

* Get around eslint error for spec

* Small changes based on comments
This commit is contained in:
vera-liu
2016-10-28 14:12:53 -07:00
committed by GitHub
parent 07a7736c71
commit 45efcb381c
11 changed files with 300 additions and 55 deletions

View File

@@ -85,3 +85,24 @@ export const now = function () {
return moment().utc().valueOf();
};
export const epochTimeXHoursAgo = function (h) {
return moment()
.subtract(h, 'hours')
.utc()
.valueOf();
};
export const epochTimeXDaysAgo = function (d) {
return moment()
.subtract(d, 'days')
.utc()
.valueOf();
};
export const epochTimeXYearsAgo = function (y) {
return moment()
.subtract(y, 'years')
.utc()
.valueOf();
};