jqueryfullcalendarinternet-explorer-11fullcalendar-2

Is Fullcalendar v2.6.0 able to work on jQuery-3.3.1 and MVC 5?


Is Fullcalendar v2.6.0 able to work on jQuery-3.3.1 and MVC 5? I have an old project which needs to be upgraded. I am using Visual Studio 2017 with jQuery-3.3.1, MVC 5.2.4 and moment.min.js 2.24 to recompile it, but I always got an error when I use IE 11:

Unhandled exception at line 3827, column 3 in http://localhost:61158/Scripts/jquery-3.3.1.js 0x800a138f - JavaScript runtime error: Unable to get property 'format' of undefined or null reference

When I use Google Chrome to debug it, I got an error message is:

Uncaught TypeError: Cannot read property 'format' of null

enter image description here

Anyone has any ideas? Thanks.

Sorry, this is my calendar code in index.cshtml.

 <script type="text/javascript">

    $(document).ready(function() {

        $('#calendar').fullCalendar({
            theme: true,
            aspectRatio: 2,
            defaultDate: '@DateTime.Now.ToString("MM-dd-yyyy")',
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            events: {
                url: '@Url.Action("GetCalendarEvents")',
                error: function () {
                    $('#script-warning').show();
                }
            },
            eventClick: function (calEvent, jsEvent, view) {
                //set the values and open the modal
                //var winWidth = $(window).width();
                //var dialogWidth = winWidth * 0.5;
                var gdiv = $("#eventInfo");
                if (gdiv != null) gdiv.empty();

                $.ajaxSetup({ cache: false });

                var request = $.ajax({
                    type: "GET",
                    url:  calEvent.ajaxUrl,
                    data: {}
                });

                request.done(function (returndata) {
                    $("#eventInfo").html(returndata);

                });


                request.fail(function (jqXHR, status) {
                    alert("Error repopulating grid : " + status + "");
                });

                $.ajaxSetup({ cache: true });

            }
        });

    });

    </script>

Solution

  • I upgraded fullCalendar to V3.9 and it is working right now. There is no error anymore except for a warning: Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to momentjs.com/guides/#/warnings/js-date for more info. But at lease the calendar is working correctly on my web app. Thanks for everyone's help. If you have any idea about the above warning, please let me know.