update from and to date index.html of all report

This commit is contained in:
Aung Myo
2017-12-07 15:51:40 +06:30
parent 1645f75fa3
commit d9fd19265b
7 changed files with 65 additions and 43 deletions

View File

@@ -151,20 +151,24 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date)
new_date = new Date(date) ;
month = parseInt(new_date.getMonth()+1)
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#from').val(from)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date)
new_date = new Date(date) ;
month = parseInt(new_date.getMonth()+1)
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
function search_by_date(){
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;