Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function () {
  2.     $('#book_date').daterangepicker({
  3.         "timePickerIncrement": 1,
  4.             "startDate": "07/28/2015", //MM/DD/YYYY
  5.         "endDate": "01/01/2018",
  6.             "minDate": "02/02/2018",
  7.             "opens": "right",
  8.             "drops": "down",
  9.             "buttonClasses": "btn btn-sm",
  10.             "applyClass": "btn-success",
  11.             "cancelClass": "btn-default",
  12.         locale: {
  13.             cancelLabel: 'Clear'
  14.         }
  15.     }, function (start, end, label) {
  16.         alert("New date range selected: '" + start.format('YYYY-MM-DD') + "' to '" + end.format('YYYY-MM-DD') + "'");
  17.     });
  18.  
  19.     $('#book_date').on('cancel.daterangepicker', function (ev, picker) {
  20.         $('#book_date').val('');
  21.         get_hall_name(document.getElementById('venue_id').value, '');
  22.     });
  23.     $('#book_date').val('');
  24.  
  25.      // New code
  26.     $('#book_date').on('apply.daterangepicker', function (ev, picker) {
  27.         var startDate = picker.startDate.format('YYYY-MM-DD');
  28.         var endDate = picker.endDate.format('YYYY-MM-DD');
  29.  
  30.         /*alert("New date range selected: '" + startDate.format('YYYY-MM-DD') + "' to '" + endDate.format('YYYY-MM-DD') + "'");*/
  31.  
  32.          $.ajax({  
  33.                           url:"penimbangan-bayi/search",  
  34.                           method:"POST",  
  35.                           data: {startDate: startDate , endDate: endDate },
  36.                           success:function(data)  
  37.                           {  
  38.  
  39.                          
  40.  
  41.                             console.log(data)
  42.                                //$('tbody').html(data);
  43.                                //window.location.replace('penimbangan-bayi/search');
  44.                           }
  45.                            
  46.                      });
  47.     });
  48.  
  49. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement