0
<script type="module">
    document.addEventListener('DOMContentLoaded',function(){
        var calendarEl = document.getElementById('calendar');
        var calendar = new FullCalendar.Calendar(calendarEl , {
            initialView: 'dayGridMonth',
            initialDate: new Date(),
            headerToolbar: {
                left: 'prev,next,today',
                center: 'title',
                right: 'dayGridMonth,timeGridWeek,timeGridDay',
            },
            dateClick: function(info){
                console.log(info);
                initializeStartDateEndDateFormat('Y-m-d',true);
                $('#exampleModal').modal('show');
            },
        });
        calendar.render();
    });
    function initializeStartDateEndDateFormat(format, allDay){
        let timePicker = !allDay;
        $('#startDateTime').datetimepicker({
            format : format,
            timepicker:timePicker
        });
        $('#endDateTime').datetimepicker({
            format : format,
            timepicker:timePicker
        });
    }
</script>

this is the code i wrote and cdn is perfect but still this error arises can't understand what the issue is.

5
  • 3
    please add the javascript dependencies(libraries) and the exact console.log error Commented Jul 1 at 17:36
  • Please provide enough code so others can better understand or reproduce the problem.
    – foxbeefly
    Commented Jul 1 at 17:42
  • In addition to the other comments, the error say the "option" is not available. This would suggest your DateTimePicker does not offer this option. Please refer to the documentation for this specific library.
    – Twisty
    Commented Jul 1 at 19:04
  • TypeError: option timepicker is not recognized! at Boolean.<anonymous> (bootstrap-datetimepicker.min.js:8:22416) at Function.each (jquery.min.js:3:5311) at l.options (bootstrap-datetimepicker.min.js:8:22372) at c (bootstrap-datetimepicker.min.js:9:2055) at HTMLInputElement.<anonymous> (bootstrap-datetimepicker.min.js:9:2427) at Function.each (jquery.min.js:3:5257) at init.each (jquery.min.js:3:2013) at a.fn.datetimepicker (bootstrap-datetimepicker.min.js:9:2297) at initializeStartDateEndDateFormat (event:146:33) at e.Calendar.dateClick Commented Jul 2 at 3:21
  • If I had to guess (based on the bootstrap-datetimepicker.min.js filename), you're using this plugin but think you're using this plugin. They are not the same. Follow the docs for the plugin you're actually using
    – Phil
    Commented Jul 2 at 4:33

0