1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| this.addAgendaItem = function(calId,title,startDate,endDate,allDay,data,displayProp){
if(calId != null && title != null && startDate != null && endDate != null && allDay != null){
// make sure start date comes before end date
if(DateUtil.secondsDifferenceDirection(startDate,endDate) < 0){
alert("Sorry, you can't create an event that ends before it starts");
return;
}
calId = stripNumberSign(calId);
var hashData = new Hashtable();
if(data != null){
for(var key in data){
hashData.put(key,data[key]);
}
}
var agi = new CalendarAgendaItem(title,startDate,endDate,allDay,hashData);
if(displayProp != null){
if(displayProp.backgroundColor != null){
agi.setBackgroundColor(displayProp.backgroundColor);
}
if(displayProp.foregroundColor != null){
agi.setForegroundColor(displayProp.foregroundColor);
}
}
var calObj = myCalendars.get(calId);
calObj.addAgendaItem(agi);
}
}; |
Partager