<script src="{{ asset(theme()->getDemo() . '/plugins/custom/flatpickr/flatpickr.bundle.js') }}"></script>
<script>
    $(document).ready(function() {
        $("#kt_datepicker_start").flatpickr({
            minDate: "1970-01-01",
            maxDate: "{{ date('Y-m-d') }}",
            dateFormat: "Y-m-d",

            onChange: function(selectedDates, dateStr, instance) {
                $('#kt_datepicker_start').val(dateStr);
            }
        });

        $("#kt_datepicker_finish").flatpickr({
            minDate: "1970-01-01",
            dateFormat: "Y-m-d",

            onChange: function(selectedDates, dateStr, instance) {
                $('#kt_datepicker_finish').val(dateStr);
            }
        });
    });
</script>
