Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
dojo.provide("dojo.cal.iCalendar");
12
dojo.require("dojo.lang.common");
13
dojo.require("dojo.cal.textDirectory");
14
dojo.require("dojo.date.common");
15
dojo.require("dojo.date.serialize");
16
dojo.cal.iCalendar.fromText = function (text) {
17
	var properties = dojo.cal.textDirectory.tokenise(text);
18
	var calendars = [];
19
	for (var i = 0, begun = false; i < properties.length; i++) {
20
		var prop = properties[i];
21
		if (!begun) {
22
			if (prop.name == "BEGIN" && prop.value == "VCALENDAR") {
23
				begun = true;
24
				var calbody = [];
25
			}
26
		} else {
27
			if (prop.name == "END" && prop.value == "VCALENDAR") {
28
				calendars.push(new dojo.cal.iCalendar.VCalendar(calbody));
29
				begun = false;
30
			} else {
31
				calbody.push(prop);
32
			}
33
		}
34
	}
35
	return calendars;
36
};
37
dojo.cal.iCalendar.Component = function (body) {
38
	if (!this.name) {
39
		this.name = "COMPONENT";
40
	}
41
	this.properties = [];
42
	this.components = [];
43
	if (body) {
44
		for (var i = 0, context = ""; i < body.length; i++) {
45
			if (context == "") {
46
				if (body[i].name == "BEGIN") {
47
					context = body[i].value;
48
					var childprops = [];
49
				} else {
50
					this.addProperty(new dojo.cal.iCalendar.Property(body[i]));
51
				}
52
			} else {
53
				if (body[i].name == "END" && body[i].value == context) {
54
					if (context == "VEVENT") {
55
						this.addComponent(new dojo.cal.iCalendar.VEvent(childprops));
56
					} else {
57
						if (context == "VTIMEZONE") {
58
							this.addComponent(new dojo.cal.iCalendar.VTimeZone(childprops));
59
						} else {
60
							if (context == "VTODO") {
61
								this.addComponent(new dojo.cal.iCalendar.VTodo(childprops));
62
							} else {
63
								if (context == "VJOURNAL") {
64
									this.addComponent(new dojo.cal.iCalendar.VJournal(childprops));
65
								} else {
66
									if (context == "VFREEBUSY") {
67
										this.addComponent(new dojo.cal.iCalendar.VFreeBusy(childprops));
68
									} else {
69
										if (context == "STANDARD") {
70
											this.addComponent(new dojo.cal.iCalendar.Standard(childprops));
71
										} else {
72
											if (context == "DAYLIGHT") {
73
												this.addComponent(new dojo.cal.iCalendar.Daylight(childprops));
74
											} else {
75
												if (context == "VALARM") {
76
													this.addComponent(new dojo.cal.iCalendar.VAlarm(childprops));
77
												} else {
78
													dojo.unimplemented("dojo.cal.iCalendar." + context);
79
												}
80
											}
81
										}
82
									}
83
								}
84
							}
85
						}
86
					}
87
					context = "";
88
				} else {
89
					childprops.push(body[i]);
90
				}
91
			}
92
		}
93
		if (this._ValidProperties) {
94
			this.postCreate();
95
		}
96
	}
97
};
98
dojo.extend(dojo.cal.iCalendar.Component, {addProperty:function (prop) {
99
	this.properties.push(prop);
100
	this[prop.name.toLowerCase()] = prop;
101
}, addComponent:function (prop) {
102
	this.components.push(prop);
103
}, postCreate:function () {
104
	for (var x = 0; x < this._ValidProperties.length; x++) {
105
		var evtProperty = this._ValidProperties[x];
106
		var found = false;
107
		for (var y = 0; y < this.properties.length; y++) {
108
			var prop = this.properties[y];
109
			var propName = prop.name.toLowerCase();
110
			if (dojo.lang.isArray(evtProperty)) {
111
				var alreadySet = false;
112
				for (var z = 0; z < evtProperty.length; z++) {
113
					var evtPropertyName = evtProperty[z].name.toLowerCase();
114
					if ((this[evtPropertyName]) && (evtPropertyName != propName)) {
115
						alreadySet = true;
116
					}
117
				}
118
				if (!alreadySet) {
119
					this[propName] = prop;
120
				}
121
			} else {
122
				if (propName == evtProperty.name.toLowerCase()) {
123
					found = true;
124
					if (evtProperty.occurance == 1) {
125
						this[propName] = prop;
126
					} else {
127
						found = true;
128
						if (!dojo.lang.isArray(this[propName])) {
129
							this[propName] = [];
130
						}
131
						this[propName].push(prop);
132
					}
133
				}
134
			}
135
		}
136
		if (evtProperty.required && !found) {
137
			dojo.debug("iCalendar - " + this.name + ": Required Property not found: " + evtProperty.name);
138
		}
139
	}
140
	if (dojo.lang.isArray(this.rrule)) {
141
		for (var x = 0; x < this.rrule.length; x++) {
142
			var rule = this.rrule[x].value;
143
			this.rrule[x].cache = function () {
144
			};
145
			var temp = rule.split(";");
146
			for (var y = 0; y < temp.length; y++) {
147
				var pair = temp[y].split("=");
148
				var key = pair[0].toLowerCase();
149
				var val = pair[1];
150
				if ((key == "freq") || (key == "interval") || (key == "until")) {
151
					this.rrule[x][key] = val;
152
				} else {
153
					var valArray = val.split(",");
154
					this.rrule[x][key] = valArray;
155
				}
156
			}
157
		}
158
		this.recurring = true;
159
	}
160
}, toString:function () {
161
	return "[iCalendar.Component; " + this.name + ", " + this.properties.length + " properties, " + this.components.length + " components]";
162
}});
163
dojo.cal.iCalendar.Property = function (prop) {
164
	this.name = prop.name;
165
	this.group = prop.group;
166
	this.params = prop.params;
167
	this.value = prop.value;
168
};
169
dojo.extend(dojo.cal.iCalendar.Property, {toString:function () {
170
	return "[iCalenday.Property; " + this.name + ": " + this.value + "]";
171
}});
172
var _P = function (n, oc, req) {
173
	return {name:n, required:(req) ? true : false, occurance:(oc == "*" || !oc) ? -1 : oc};
174
};
175
dojo.cal.iCalendar.VCalendar = function (calbody) {
176
	this.name = "VCALENDAR";
177
	this.recurring = [];
178
	this.nonRecurringEvents = function () {
179
	};
180
	dojo.cal.iCalendar.Component.call(this, calbody);
181
};
182
dojo.inherits(dojo.cal.iCalendar.VCalendar, dojo.cal.iCalendar.Component);
183
dojo.extend(dojo.cal.iCalendar.VCalendar, {addComponent:function (prop) {
184
	this.components.push(prop);
185
	if (prop.name.toLowerCase() == "vevent") {
186
		if (prop.rrule) {
187
			this.recurring.push(prop);
188
		} else {
189
			var startDate = prop.getDate();
190
			var month = startDate.getMonth() + 1;
191
			var dateString = month + "-" + startDate.getDate() + "-" + startDate.getFullYear();
192
			if (!dojo.lang.isArray(this[dateString])) {
193
				this.nonRecurringEvents[dateString] = [];
194
			}
195
			this.nonRecurringEvents[dateString].push(prop);
196
		}
197
	}
198
}, preComputeRecurringEvents:function (until) {
199
	var calculatedEvents = function () {
200
	};
201
	for (var x = 0; x < this.recurring.length; x++) {
202
		var dates = this.recurring[x].getDates(until);
203
		for (var y = 0; y < dates.length; y++) {
204
			var month = dates[y].getMonth() + 1;
205
			var dateStr = month + "-" + dates[y].getDate() + "-" + dates[y].getFullYear();
206
			if (!dojo.lang.isArray(calculatedEvents[dateStr])) {
207
				calculatedEvents[dateStr] = [];
208
			}
209
			if (!dojo.lang.inArray(calculatedEvents[dateStr], this.recurring[x])) {
210
				calculatedEvents[dateStr].push(this.recurring[x]);
211
			}
212
		}
213
	}
214
	this.recurringEvents = calculatedEvents;
215
}, getEvents:function (date) {
216
	var events = [];
217
	var recur = [];
218
	var nonRecur = [];
219
	var month = date.getMonth() + 1;
220
	var dateStr = month + "-" + date.getDate() + "-" + date.getFullYear();
221
	if (dojo.lang.isArray(this.nonRecurringEvents[dateStr])) {
222
		nonRecur = this.nonRecurringEvents[dateStr];
223
		dojo.debug("Number of nonRecurring Events: " + nonRecur.length);
224
	}
225
	if (dojo.lang.isArray(this.recurringEvents[dateStr])) {
226
		recur = this.recurringEvents[dateStr];
227
	}
228
	events = recur.concat(nonRecur);
229
	if (events.length > 0) {
230
		return events;
231
	}
232
	return null;
233
}});
234
var StandardProperties = [_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), _P("comment"), _P("rdate"), _P("rrule"), _P("tzname")];
235
dojo.cal.iCalendar.Standard = function (body) {
236
	this.name = "STANDARD";
237
	this._ValidProperties = StandardProperties;
238
	dojo.cal.iCalendar.Component.call(this, body);
239
};
240
dojo.inherits(dojo.cal.iCalendar.Standard, dojo.cal.iCalendar.Component);
241
var DaylightProperties = [_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), _P("comment"), _P("rdate"), _P("rrule"), _P("tzname")];
242
dojo.cal.iCalendar.Daylight = function (body) {
243
	this.name = "DAYLIGHT";
244
	this._ValidProperties = DaylightProperties;
245
	dojo.cal.iCalendar.Component.call(this, body);
246
};
247
dojo.inherits(dojo.cal.iCalendar.Daylight, dojo.cal.iCalendar.Component);
248
var VEventProperties = [_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1), _P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("transp", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), [_P("dtend", 1), _P("duration", 1)], _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"), _P("rdate"), _P("rrule")];
249
dojo.cal.iCalendar.VEvent = function (body) {
250
	this._ValidProperties = VEventProperties;
251
	this.name = "VEVENT";
252
	dojo.cal.iCalendar.Component.call(this, body);
253
	this.recurring = false;
254
	this.startDate = dojo.date.fromIso8601(this.dtstart.value);
255
};
256
dojo.inherits(dojo.cal.iCalendar.VEvent, dojo.cal.iCalendar.Component);
257
dojo.extend(dojo.cal.iCalendar.VEvent, {getDates:function (until) {
258
	var dtstart = this.getDate();
259
	var recurranceSet = [];
260
	var weekdays = ["su", "mo", "tu", "we", "th", "fr", "sa"];
261
	var order = {"daily":1, "weekly":2, "monthly":3, "yearly":4, "byday":1, "bymonthday":1, "byweekno":2, "bymonth":3, "byyearday":4};
262
	for (var x = 0; x < this.rrule.length; x++) {
263
		var rrule = this.rrule[x];
264
		var freq = rrule.freq.toLowerCase();
265
		var interval = 1;
266
		if (rrule.interval > interval) {
267
			interval = rrule.interval;
268
		}
269
		var set = [];
270
		var freqInt = order[freq];
271
		if (rrule.until) {
272
			var tmpUntil = dojo.date.fromIso8601(rrule.until);
273
		} else {
274
			var tmpUntil = until;
275
		}
276
		if (tmpUntil > until) {
277
			tmpUntil = until;
278
		}
279
		if (dtstart < tmpUntil) {
280
			var expandingRules = function () {
281
			};
282
			var cullingRules = function () {
283
			};
284
			expandingRules.length = 0;
285
			cullingRules.length = 0;
286
			switch (freq) {
287
			  case "yearly":
288
				var nextDate = new Date(dtstart);
289
				set.push(nextDate);
290
				while (nextDate < tmpUntil) {
291
					nextDate.setYear(nextDate.getFullYear() + interval);
292
					tmpDate = new Date(nextDate);
293
					if (tmpDate < tmpUntil) {
294
						set.push(tmpDate);
295
					}
296
				}
297
				break;
298
			  case "monthly":
299
				nextDate = new Date(dtstart);
300
				set.push(nextDate);
301
				while (nextDate < tmpUntil) {
302
					nextDate.setMonth(nextDate.getMonth() + interval);
303
					var tmpDate = new Date(nextDate);
304
					if (tmpDate < tmpUntil) {
305
						set.push(tmpDate);
306
					}
307
				}
308
				break;
309
			  case "weekly":
310
				nextDate = new Date(dtstart);
311
				set.push(nextDate);
312
				while (nextDate < tmpUntil) {
313
					nextDate.setDate(nextDate.getDate() + (7 * interval));
314
					var tmpDate = new Date(nextDate);
315
					if (tmpDate < tmpUntil) {
316
						set.push(tmpDate);
317
					}
318
				}
319
				break;
320
			  case "daily":
321
				nextDate = new Date(dtstart);
322
				set.push(nextDate);
323
				while (nextDate < tmpUntil) {
324
					nextDate.setDate(nextDate.getDate() + interval);
325
					var tmpDate = new Date(nextDate);
326
					if (tmpDate < tmpUntil) {
327
						set.push(tmpDate);
328
					}
329
				}
330
				break;
331
			}
332
			if ((rrule["bymonth"]) && (order["bymonth"] < freqInt)) {
333
				for (var z = 0; z < rrule["bymonth"].length; z++) {
334
					if (z == 0) {
335
						for (var zz = 0; zz < set.length; zz++) {
336
							set[zz].setMonth(rrule["bymonth"][z] - 1);
337
						}
338
					} else {
339
						var subset = [];
340
						for (var zz = 0; zz < set.length; zz++) {
341
							var newDate = new Date(set[zz]);
342
							newDate.setMonth(rrule[z]);
343
							subset.push(newDate);
344
						}
345
						tmp = set.concat(subset);
346
						set = tmp;
347
					}
348
				}
349
			}
350
			if (rrule["byweekno"] && !rrule["bymonth"]) {
351
				dojo.debug("TODO: no support for byweekno yet");
352
			}
353
			if (rrule["byyearday"] && !rrule["bymonth"] && !rrule["byweekno"]) {
354
				if (rrule["byyearday"].length > 1) {
355
					var regex = "([+-]?)([0-9]{1,3})";
356
					for (var z = 1; x < rrule["byyearday"].length; z++) {
357
						var regexResult = rrule["byyearday"][z].match(regex);
358
						if (z == 1) {
359
							for (var zz = 0; zz < set.length; zz++) {
360
								if (regexResult[1] == "-") {
361
									dojo.date.setDayOfYear(set[zz], 366 - regexResult[2]);
362
								} else {
363
									dojo.date.setDayOfYear(set[zz], regexResult[2]);
364
								}
365
							}
366
						} else {
367
							var subset = [];
368
							for (var zz = 0; zz < set.length; zz++) {
369
								var newDate = new Date(set[zz]);
370
								if (regexResult[1] == "-") {
371
									dojo.date.setDayOfYear(newDate, 366 - regexResult[2]);
372
								} else {
373
									dojo.date.setDayOfYear(newDate, regexResult[2]);
374
								}
375
								subset.push(newDate);
376
							}
377
							tmp = set.concat(subset);
378
							set = tmp;
379
						}
380
					}
381
				}
382
			}
383
			if (rrule["bymonthday"] && (order["bymonthday"] < freqInt)) {
384
				if (rrule["bymonthday"].length > 0) {
385
					var regex = "([+-]?)([0-9]{1,3})";
386
					for (var z = 0; z < rrule["bymonthday"].length; z++) {
387
						var regexResult = rrule["bymonthday"][z].match(regex);
388
						if (z == 0) {
389
							for (var zz = 0; zz < set.length; zz++) {
390
								if (regexResult[1] == "-") {
391
									if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
392
										set[zz].setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
393
									}
394
								} else {
395
									if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
396
										set[zz].setDate(regexResult[2]);
397
									}
398
								}
399
							}
400
						} else {
401
							var subset = [];
402
							for (var zz = 0; zz < set.length; zz++) {
403
								var newDate = new Date(set[zz]);
404
								if (regexResult[1] == "-") {
405
									if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
406
										newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
407
									}
408
								} else {
409
									if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
410
										newDate.setDate(regexResult[2]);
411
									}
412
								}
413
								subset.push(newDate);
414
							}
415
							tmp = set.concat(subset);
416
							set = tmp;
417
						}
418
					}
419
				}
420
			}
421
			if (rrule["byday"] && (order["byday"] < freqInt)) {
422
				if (rrule["bymonth"]) {
423
					if (rrule["byday"].length > 0) {
424
						var regex = "([+-]?)([0-9]{0,1}?)([A-Za-z]{1,2})";
425
						for (var z = 0; z < rrule["byday"].length; z++) {
426
							var regexResult = rrule["byday"][z].match(regex);
427
							var occurance = regexResult[2];
428
							var day = regexResult[3].toLowerCase();
429
							if (z == 0) {
430
								for (var zz = 0; zz < set.length; zz++) {
431
									if (regexResult[1] == "-") {
432
										var numDaysFound = 0;
433
										var lastDayOfMonth = dojo.date.getDaysInMonth(set[zz]);
434
										var daysToSubtract = 1;
435
										set[zz].setDate(lastDayOfMonth);
436
										if (weekdays[set[zz].getDay()] == day) {
437
											numDaysFound++;
438
											daysToSubtract = 7;
439
										}
440
										daysToSubtract = 1;
441
										while (numDaysFound < occurance) {
442
											set[zz].setDate(set[zz].getDate() - daysToSubtract);
443
											if (weekdays[set[zz].getDay()] == day) {
444
												numDaysFound++;
445
												daysToSubtract = 7;
446
											}
447
										}
448
									} else {
449
										if (occurance) {
450
											var numDaysFound = 0;
451
											set[zz].setDate(1);
452
											var daysToAdd = 1;
453
											if (weekdays[set[zz].getDay()] == day) {
454
												numDaysFound++;
455
												daysToAdd = 7;
456
											}
457
											while (numDaysFound < occurance) {
458
												set[zz].setDate(set[zz].getDate() + daysToAdd);
459
												if (weekdays[set[zz].getDay()] == day) {
460
													numDaysFound++;
461
													daysToAdd = 7;
462
												}
463
											}
464
										} else {
465
											var numDaysFound = 0;
466
											var subset = [];
467
											lastDayOfMonth = new Date(set[zz]);
468
											var daysInMonth = dojo.date.getDaysInMonth(set[zz]);
469
											lastDayOfMonth.setDate(daysInMonth);
470
											set[zz].setDate(1);
471
											if (weekdays[set[zz].getDay()] == day) {
472
												numDaysFound++;
473
											}
474
											var tmpDate = new Date(set[zz]);
475
											daysToAdd = 1;
476
											while (tmpDate.getDate() < lastDayOfMonth) {
477
												if (weekdays[tmpDate.getDay()] == day) {
478
													numDaysFound++;
479
													if (numDaysFound == 1) {
480
														set[zz] = tmpDate;
481
													} else {
482
														subset.push(tmpDate);
483
														tmpDate = new Date(tmpDate);
484
														daysToAdd = 7;
485
														tmpDate.setDate(tmpDate.getDate() + daysToAdd);
486
													}
487
												} else {
488
													tmpDate.setDate(tmpDate.getDate() + daysToAdd);
489
												}
490
											}
491
											var t = set.concat(subset);
492
											set = t;
493
										}
494
									}
495
								}
496
							} else {
497
								var subset = [];
498
								for (var zz = 0; zz < set.length; zz++) {
499
									var newDate = new Date(set[zz]);
500
									if (regexResult[1] == "-") {
501
										if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
502
											newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
503
										}
504
									} else {
505
										if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
506
											newDate.setDate(regexResult[2]);
507
										}
508
									}
509
									subset.push(newDate);
510
								}
511
								tmp = set.concat(subset);
512
								set = tmp;
513
							}
514
						}
515
					}
516
				} else {
517
					dojo.debug("TODO: byday within a yearly rule without a bymonth");
518
				}
519
			}
520
			dojo.debug("TODO: Process BYrules for units larger than frequency");
521
			var tmp = recurranceSet.concat(set);
522
			recurranceSet = tmp;
523
		}
524
	}
525
	recurranceSet.push(dtstart);
526
	return recurranceSet;
527
}, getDate:function () {
528
	return dojo.date.fromIso8601(this.dtstart.value);
529
}});
530
var VTimeZoneProperties = [_P("tzid", 1, true), _P("last-mod", 1), _P("tzurl", 1)];
531
dojo.cal.iCalendar.VTimeZone = function (body) {
532
	this.name = "VTIMEZONE";
533
	this._ValidProperties = VTimeZoneProperties;
534
	dojo.cal.iCalendar.Component.call(this, body);
535
};
536
dojo.inherits(dojo.cal.iCalendar.VTimeZone, dojo.cal.iCalendar.Component);
537
var VTodoProperties = [_P("class", 1), _P("completed", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1), _P("percent", 1), _P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), [_P("due", 1), _P("duration", 1)], _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"), _P("rdate"), _P("rrule")];
538
dojo.cal.iCalendar.VTodo = function (body) {
539
	this.name = "VTODO";
540
	this._ValidProperties = VTodoProperties;
541
	dojo.cal.iCalendar.Component.call(this, body);
542
};
543
dojo.inherits(dojo.cal.iCalendar.VTodo, dojo.cal.iCalendar.Component);
544
var VJournalProperties = [_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("last-mod", 1), _P("organizer", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("related"), _P("rstatus"), _P("rdate"), _P("rrule")];
545
dojo.cal.iCalendar.VJournal = function (body) {
546
	this.name = "VJOURNAL";
547
	this._ValidProperties = VJournalProperties;
548
	dojo.cal.iCalendar.Component.call(this, body);
549
};
550
dojo.inherits(dojo.cal.iCalendar.VJournal, dojo.cal.iCalendar.Component);
551
var VFreeBusyProperties = [_P("contact"), _P("dtstart", 1), _P("dtend"), _P("duration"), _P("organizer", 1), _P("dtstamp", 1), _P("uid", 1), _P("url", 1), _P("attendee"), _P("comment"), _P("freebusy"), _P("rstatus")];
552
dojo.cal.iCalendar.VFreeBusy = function (body) {
553
	this.name = "VFREEBUSY";
554
	this._ValidProperties = VFreeBusyProperties;
555
	dojo.cal.iCalendar.Component.call(this, body);
556
};
557
dojo.inherits(dojo.cal.iCalendar.VFreeBusy, dojo.cal.iCalendar.Component);
558
var VAlarmProperties = [[_P("action", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)], _P("attach", 1)], [_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)]], [_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true), _P("summary", 1, true), _P("attendee", "*", true), [_P("duration", 1), _P("repeat", 1)], _P("attach", 1)], [_P("action", 1, true), _P("attach", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)], _P("description", 1)]];
559
dojo.cal.iCalendar.VAlarm = function (body) {
560
	this.name = "VALARM";
561
	this._ValidProperties = VAlarmProperties;
562
	dojo.cal.iCalendar.Component.call(this, body);
563
};
564
dojo.inherits(dojo.cal.iCalendar.VAlarm, dojo.cal.iCalendar.Component);
565