i have one situation.i add all hotel booking appointmetns to webmonthview.when user clicking on the particular day.i want to open the appointment dialog(not for holidays and not for schedule days).i got solution almost but when user click on the white box(in figure) in the schedule days appointment dialog is opening.
there should be only one appoinment for a day.user click on white box(in figure) not have to display dialog because already one appoiontment in that day
my code snippet and diagram shown.......
function OpenCalendarEvent(oScheduleInfo, oEvent, oDialog, oActivity) {var da= oActivity.getStartDateTime().toString();if(da.substring(0,3)=='Sat' || da.substring(0,3)=='Sun'){//canceled the appointment dialog for week endsoEvent.cancel = true; }else if(oActivity.getDataKey()==null){ Event.cancel = false; }else{//canceled the appointment dialog for scheduled oEvent.cancel = true; }}
please suggest me any approach for getting that requirement.
Hello,
I'm not 100% sure what youre asking for, so if i'm incorrect in my assumption, i apologize.
However, i think you're trying to detect if the dialog is opening for a day that already has an activity. And if it does, you want to cancel the dialog. Is this correct?
If so, you should be able to achieve it by using the following:
var appts = oScheduleInfo.getActitivites();
for(var i = 0; i < appts.length; i++)
{
// Compare appts[i].getStartDateTime() with oActivity.getStartDateTime()
// Note: they won't be exactly the same, so you'll need to check that the day and month both match up.
}
Hope this helps,
-SteveZ
thank you stephen
i already tried with same approach even i did not get because the appointments are not single day some of may multidays then we have to compare start time and end time of activities too.
but unfortunately enddatetime() method is not present for activity on client side.
to acheive that duration also have to set ,by using duration and starttime() get the endtime()
finally i got it but it was going with complex process........