Invalid Date

I've got the below config, but when the data is returned, no appointments are showing up and the _currentAppointmentData shows both the StartTime and EndTime as "Invalid Date". I've inspected the data being returned, and the dates look fine - standard DateTime property with value 3/6/2018 12:00:00 AM, for example. I am also using a standard return Json(results, JsonRequestBehavior.AllowGet). Please advise as to what the issue might be.

        var dm = ej.DataManager({
            url: "/Calendar/GetCalendarEvents",
            adaptor: new ej.UrlAdaptor()
        });

        self.calendar = $("#globalCalendar").ejSchedule({
            currentDate: new Date(),
            currentView: ej.Schedule.CurrentView.Month,
            allowDragAndDrop: false,
            showCurrentTimeIndicator: false,
            showAppointmentNavigator: false,
            readOnly: true,
            enableLoadOnDemand: true,
            appointmentClick: function(args, e) {
                args.cancel = true;
                window.calendarEventId = args.appointment.Id;
            },
            appointmentSettings: {
                dataSource: dm,
                id: "Id",
                subject: "Subject",
                startTime: "StartTime",
                endTime: "EndTime"
            }
        });

1 Reply

VS Velmurugan S Syncfusion Team March 29, 2018 05:57 PM UTC

Hi Matt, 

Thanks for Contacting Syncfusion support. 

We were unable to reproduce the reported issue in the prepared sample in which we have used your given code example. Therefore, we suspect that the reason of this issue might be the date value coming from the controller page is in wrong format in your sample. The prepared sample can be downloaded from the following location. 


Kindly try with the above sample, If you still face the same problem at your end, kindly revert back to us with some more details like complete code example (Server side code and request result details – check it in browser network tab) and If possible, try to reproduce the issue in the above sample. The information that you share will be helpful for us to proceed further on this and provide you with prompt solution. 

Regards, 
Velmurugan 


Loader.
Up arrow icon