     <script src="https://cdn.datatables.net/1.11.0/js/jquery.dataTables.min.js"></script>
     <script src="https://cdn.datatables.net/1.11.0/js/dataTables.bootstrap5.min.js"></script>
     <script type="text/javascript">
        $(document).ready(function()
        {
            var start = moment().subtract(1, 'days');
            var end = moment();

            //$("#datatable").DataTable({ });

          function cb(start, end) {
            <?php if(isset($_GET['tgl'])) { ?>
            $('#reportrange span').html('<?php echo $filterRangeDate; ?>');
            <?php }else{ ?>
            $('#reportrange span').html(end.format('DD MMM YY'));
            <?php } ?>
          }

          $('#reportrange').daterangepicker({
            singleDatePicker: true,
            showDropdowns: true,
            minYear: 2019,
            maxYear: parseInt(moment().format('YYYY'),10),
            locale: {
                format: 'YYYY-MM-DD'
            }
          }, cb);

          cb(start, end);

          $('#rangedateplacement').on('DOMSubtreeModified', function(){
            var rawrangedate = $(this).html();
            rawrangedate = rawrangedate.replace(" ", "");
            rawrangedate = rawrangedate.replace(" ", "");
            rawrangedate = rawrangedate.replace(" ", "");
            rawrangedate = rawrangedate.replace(" ", "");
            rawrangedate = rawrangedate.replace(" ", "");
            rawrangedate = rawrangedate.replace(" ", "");
            document.location.href = "<?php echo BASEURL; ?>home.php?page=lapcurahhujan&tgl=" + rawrangedate;
          });

        });

        $(window).on("load", function () {



        });

          
     </script>