Telerik.Web.UI.Scheduler.Rendering.WebServiceRenderingManager.prototype._loadAppointment =
function
(aptData) {
var
startString = aptData.Start;
var
startDate =
this
._toClientDate(startString)
// https://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript
if
(isNaN(startDate.getTime())) {
// d.valueOf() could also work
// date is not valid
aptData.Start =
new
Date(startString)
}
var
endString = aptData.End;
var
endDate =
this
._toClientDate(endString)
if
(isNaN(endDate.getTime())) {
// d.valueOf() could also work
// date is not valid
aptData.End =
new
Date(endString)
}
var
appointment =
new
Telerik.Web.UI.SchedulerAppointment();
appointment._id = aptData.ID;
appointment._internalID = aptData.EncodedID;
appointment.set_subject(aptData.Subject);
appointment.set_description(aptData.Description);
appointment.set_start(
this
._toClientDate(aptData.Start));
appointment.set_end(
this
._toClientDate(aptData.End));
appointment._setOwner(
this
._owner);
appointment._recurrenceRule = aptData.RecurrenceRule;
appointment._recurrenceParentID = aptData.RecurrenceParentID;
appointment._internalRecurrenceParentID = aptData.EncodedRecurrenceParentID;
appointment._recurrenceState = aptData.RecurrenceState;
appointment._visible = aptData.Visible;
appointment.set_toolTip(aptData.Subject);
appointment.set_timeZoneID(aptData.TimeZoneID);
if
(aptData.Resources)
this
._loadResources(appointment.get_resources(), aptData.Resources);
if
(aptData.Attributes)
this
._loadAttributes(appointment.get_attributes(), aptData.Attributes);
if
(aptData.Reminders && appointment.get_reminders)
this
._loadReminders(appointment, aptData.Reminders);
return
appointment;
}