clear buttom in datepickere

This commit is contained in:
Aung Myo
2017-11-15 09:44:52 +06:30
parent 28dbb75774
commit de3f2e5e90
6 changed files with 43 additions and 27 deletions

View File

@@ -83,17 +83,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
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();
var period = 0;
var period_type = 1;

View File

@@ -141,20 +141,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
console.log(from);
console.log(to);
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();
var period = 0;
var period_type = 1;
if(to != '' && from != ''){

View File

@@ -147,17 +147,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
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();
var period = 0;
var period_type = 1;

View File

@@ -211,17 +211,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
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();
var period = 0;
var period_type = 1;

View File

@@ -145,18 +145,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
console.log(date);
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
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();
var period = 0;
var period_type = 1;

View File

@@ -105,17 +105,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
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();
var period = 0;
var period_type = 1;