This is a migrated thread and some comments may be shown as answers.

[Solved] Corrected isSlotFree sample

1 Answer 71 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
antonio
Top achievements
Rank 1
antonio asked on 20 Jun 2008, 08:02 PM
Hello,
I have expanded the "isSlotFree" function to work correctly when you use the 'Month' view in RadScheduler.  The way it's coded now only works for 'Day' or 'Week' view styles:

function

isSlotFree(targetSlot, appointment)

{

var startTime = targetSlot.get_startTime();

var scheduler = $find("<%= RadScheduler1.ClientID %>");

var currentView = scheduler.get_selectedView();

if(currentView==2)

// concatenate new startDate with appointments time portion if in MONTHLY view only

{

var originalStartTime = appointment.get_start();

var newHour = originalStartTime.getHours();

var newMinute = originalStartTime.getMinutes();

var newSecond = originalStartTime.getSeconds();

startTime.setHours(newHour);

startTime.setMinutes(newMinute);

startTime.setSeconds(newSecond);

var endTime = new Date(startTime.getTime() + appointment._getDuration());

}

else

{

var endTime = new Date(startTime.getTime() + appointment._getDuration());

}

return overlapsWithAnotherAppointment(appointment, startTime, endTime);

}

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 23 Jun 2008, 05:13 PM
Hi antonio,

Thank you for extending the isSlotFree function and sharing it with the community.

We will also update our online example to work in Month View using the extended function.

Your Telerik points have been updated for the contribution.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
antonio
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or