add date range filter
This commit is contained in:
@@ -45,10 +45,14 @@ html, body {
|
||||
background-color: #AAA;
|
||||
}
|
||||
|
||||
#search-bar .autocomplete, #search-bar .autocomplete ul {
|
||||
#search-bar .autocomplete {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
#search-bar #search-input {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#filter-bar {
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,13 @@
|
||||
<option value="FEWEST_VALUES">fewest values</option>
|
||||
</select>
|
||||
<input type="number" id="search-limit-value" name="search-limit-value" min="1" max="1000000" value="10" style="display: none;"/>
|
||||
|
||||
<label>From Date:</label>
|
||||
<input id="search-date-from" type="date">
|
||||
|
||||
<label>To Date:</label>
|
||||
<input id="search-date-to" type="date">
|
||||
|
||||
<button id="search-submit"><i class="fa fa-area-chart"> Plot</i></button>
|
||||
</div>
|
||||
<div id="result-view">
|
||||
|
||||
@@ -3,12 +3,12 @@ $(document).ready(function(){
|
||||
|
||||
$('#search-submit').click(plot);
|
||||
|
||||
renderFields();
|
||||
renderGroupBy();
|
||||
|
||||
$('#search-limit-by').change(function () {
|
||||
var optionSelected = $(this).find("option:selected");
|
||||
var valueSelected = optionSelected.val();
|
||||
console.log(valueSelected);
|
||||
|
||||
if (valueSelected == "NO_LIMIT"){
|
||||
$('#search-limit-value').hide();
|
||||
}else{
|
||||
@@ -23,6 +23,9 @@ $(document).ready(function(){
|
||||
var caretIndex = document.getElementById('search-input').selectionStart;
|
||||
return 'caretIndex=' + caretIndex + '&query';
|
||||
},
|
||||
_Pre: function() {
|
||||
return encodeURI(this.Input.value);
|
||||
},
|
||||
_Post: function(response) {
|
||||
var result = [];
|
||||
var responseObject = JSON.parse(response);
|
||||
@@ -40,10 +43,9 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
function renderFields()
|
||||
function renderGroupBy()
|
||||
{
|
||||
var request = {};
|
||||
request['query'] = $('#search-input').val();
|
||||
|
||||
var success = function(response){
|
||||
|
||||
@@ -85,6 +87,8 @@ function plot(event){
|
||||
request['groupBy'] = $('#search-group-by').val();
|
||||
request['limitBy'] = $('#search-limit-by').val();
|
||||
request['limit'] = parseInt($('#search-limit-value').val());
|
||||
request['dateFrom'] = $('#search-date-from').val();
|
||||
request['dateTo'] = $('#search-date-to').val();
|
||||
|
||||
|
||||
var success = function(response){
|
||||
|
||||
Reference in New Issue
Block a user