<script type="text/javascript">
$(function () {
var dManager = ej.DataManager(window.Default).executeLocal(ej.Query().take(10));
$("#Schedule1").ejSchedule({
width: "100%",
height: "525px",
currentDate: new Date(2014, 4, 5),
appointmentSettings: {
-----------
-----------
},
dragStop: "OnDragStop" //this event will trigger when the appointment is dragged and dropped
});
});
function OnDragStop(args) {
var start = args.appointment.StartTime; // start time of the appointmnt will be retrived
var starthr = 5 * Math.round(start.getMinutes() / 5); // here we are rounding off the minutes
if (starthr == 60) {
args.appointment.StartTime.setHours(args.appointment.StartTime.getHours() + 1); // here we are incrementing the start hour when the minutes is equal to 60
}
args.appointment.StartTime.setMinutes((Math.round(start.getMinutes() / 5) * 5) % 60); // here we are adding the round off start minutes to the appointment
var end = args.appointment.EndTime;
var endhr = 5 * Math.round(end.getMinutes() / 5);
if (endhr == 60) {
args.appointment.EndTime.setHours(args.appointment.EndTime.getHours() + 1);
}
args.appointment.EndTime.setMinutes((Math.round(end.getMinutes() / 5) * 5) % 60);
}
</script>
</Code>
Regards,
Karthigeyan