Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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