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.widget.DatePicker");
12
dojo.require("dojo.date.common");
13
dojo.require("dojo.date.format");
14
dojo.require("dojo.date.serialize");
15
dojo.require("dojo.widget.*");
16
dojo.require("dojo.widget.HtmlWidget");
17
dojo.require("dojo.event.*");
18
dojo.require("dojo.dom");
19
dojo.require("dojo.html.style");
20
dojo.widget.defineWidget("dojo.widget.DatePicker", dojo.widget.HtmlWidget, {value:"", name:"", displayWeeks:6, adjustWeeks:false, startDate:"1492-10-12", endDate:"2941-10-12", weekStartsOn:"", staticDisplay:false, dayWidth:"narrow", classNames:{previous:"previousMonth", disabledPrevious:"previousMonthDisabled", current:"currentMonth", disabledCurrent:"currentMonthDisabled", next:"nextMonth", disabledNext:"nextMonthDisabled", currentDate:"currentDate", selectedDate:"selectedDate"}, templateString:"<div class=\"datePickerContainer\" dojoAttachPoint=\"datePickerContainerNode\">\n\t<table cellspacing=\"0\" cellpadding=\"0\" class=\"calendarContainer\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<td class=\"monthWrapper\" valign=\"top\">\n\t\t\t\t\t<table class=\"monthContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td class=\"monthLabelContainer\" valign=\"top\">\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"increaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\talt=\"&darr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"increaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&darr;\"  dojoAttachPoint=\"incrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" alt=\"&uarr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&uarr;\" dojoAttachPoint=\"decrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"monthLabelNode\" class=\"month\"></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<table class=\"calendarBodyContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"dayLabelsRow\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"calendarDatesContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: _handleUiClick;\">\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"calendarWeekTemplate\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\" class=\"yearWrapper\">\n\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"yearContainer\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"curveBL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t\t<h3 class=\"yearLabel\">\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\"\n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"previousYear\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"selectedYear\" dojoAttachPoint=\"currentYearLabelNode\"></span>\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" \n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"nextYear\"></span>\n\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"curveBR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n</div>\n", templateCssString:".datePickerContainer {\n\twidth:164px; /* needed for proper user styling */\n}\n\n.calendarContainer {\n/*\tborder:1px solid #566f8f;*/\n}\n\n.calendarBodyContainer {\n\twidth:100%; /* needed for the explode effect (explain?) */\n\tbackground: #7591bc url(\"images/dpBg.gif\") top left repeat-x;\n}\n\n.calendarBodyContainer thead tr td {\n\tcolor:#293a4b;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.25em;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.calendarBodyContainer tbody tr td {\n\tcolor:#fff;\n\tfont:bold 0.7em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.4em;\n\tbackground: url(\"images/dpVertLine.gif\") top right repeat-y;\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n\n.monthWrapper {\n\tpadding-bottom:2px;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.monthContainer {\n\twidth:100%;\n}\n\n.monthLabelContainer {\n\ttext-align:center;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\tbackground: url(\"images/dpMonthBg.png\") repeat-x top left !important;\n\tcolor:#293a4b;\n\tpadding:0.25em;\n}\n\n.monthCurve {\n\twidth:12px;\n}\n\n.monthCurveTL {\n\tbackground: url(\"images/dpCurveTL.png\") no-repeat top left !important;\n}\n\n.monthCurveTR {\n\t\tbackground: url(\"images/dpCurveTR.png\") no-repeat top right !important;\n}\n\n\n.yearWrapper {\n\tbackground: url(\"images/dpHorizLineFoot.gif\") top left repeat-x;\n\tpadding-top:2px;\n}\n\n.yearContainer {\n\twidth:100%;\n}\n\n.yearContainer td {\n\tbackground:url(\"images/dpYearBg.png\") top left repeat-x;\n}\n\n.yearContainer .yearLabel {\n\tmargin:0;\n\tpadding:0.45em 0 0.45em 0;\n\tcolor:#fff;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n}\n\n.curveBL {\n\tbackground: url(\"images/dpCurveBL.png\") bottom left no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.curveBR {\n\tbackground: url(\"images/dpCurveBR.png\") bottom right no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n\n.previousMonth {\n\tbackground-color:#6782a8 !important;\n}\n\n.previousMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important\n}\n.currentMonth {\n}\n\n.currentMonthDisabled {\n\tbackground-color:#bbbbbc !important;\n\tcursor:default !important\n}\n.nextMonth {\n\tbackground-color:#6782a8 !important;\n}\n.nextMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important;\n}\n\n.currentDate {\n\ttext-decoration:underline;\n\tfont-style:italic;\n}\n\n.selectedDate {\n\tbackground-color:#fff !important;\n\tcolor:#6782a8 !important;\n}\n\n.yearLabel .selectedYear {\n\tpadding:0.2em;\n\tbackground-color:#9ec3fb !important;\n}\n\n.nextYear, .previousYear {\n\tcursor:pointer;cursor:hand;\n\tpadding:0;\n}\n\n.nextYear {\n\tmargin:0 0 0 0.55em;\n}\n\n.previousYear {\n\tmargin:0 0.55em 0 0;\n}\n\n.incrementControl {\n\tcursor:pointer;cursor:hand;\n\twidth:1em;\n}\n\n.increase {\n\tfloat:right;\n}\n\n.decrease {\n\tfloat:left;\n}\n\n.lastColumn {\n\tbackground-image:none !important;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/DatePicker.css"), postMixInProperties:function () {
21
	dojo.widget.DatePicker.superclass.postMixInProperties.apply(this, arguments);
22
	if (!this.weekStartsOn) {
23
		this.weekStartsOn = dojo.date.getFirstDayOfWeek(this.lang);
24
	}
25
	this.today = new Date();
26
	this.today.setHours(0, 0, 0, 0);
27
	if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
28
		this.value = new Date();
29
	} else {
30
		if (this.value && (typeof this.value == "string") && (this.value.split("-").length > 2)) {
31
			this.value = dojo.date.fromRfc3339(this.value);
32
			this.value.setHours(0, 0, 0, 0);
33
		}
34
	}
35
}, fillInTemplate:function (args, frag) {
36
	dojo.widget.DatePicker.superclass.fillInTemplate.apply(this, arguments);
37
	var source = this.getFragNodeRef(frag);
38
	dojo.html.copyStyle(this.domNode, source);
39
	this.weekTemplate = dojo.dom.removeNode(this.calendarWeekTemplate);
40
	this._preInitUI(this.value ? this.value : this.today, false, true);
41
	var dayLabels = dojo.lang.unnest(dojo.date.getNames("days", this.dayWidth, "standAlone", this.lang));
42
	if (this.weekStartsOn > 0) {
43
		for (var i = 0; i < this.weekStartsOn; i++) {
44
			dayLabels.push(dayLabels.shift());
45
		}
46
	}
47
	var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");
48
	for (i = 0; i < 7; i++) {
49
		dayLabelNodes.item(i).innerHTML = dayLabels[i];
50
	}
51
	if (this.value) {
52
		this.setValue(this.value);
53
	}
54
}, getValue:function () {
55
	return dojo.date.toRfc3339(new Date(this.value), "dateOnly");
56
}, getDate:function () {
57
	return this.value;
58
}, setValue:function (rfcDate) {
59
	this.setDate(rfcDate);
60
}, setDate:function (dateObj) {
61
	if (dateObj == "") {
62
		this.value = "";
63
		this._preInitUI(this.curMonth, false, true);
64
	} else {
65
		if (typeof dateObj == "string") {
66
			this.value = dojo.date.fromRfc3339(dateObj);
67
			this.value.setHours(0, 0, 0, 0);
68
		} else {
69
			this.value = new Date(dateObj);
70
			this.value.setHours(0, 0, 0, 0);
71
		}
72
	}
73
	if (this.selectedNode != null) {
74
		dojo.html.removeClass(this.selectedNode, this.classNames.selectedDate);
75
	}
76
	if (this.clickedNode != null) {
77
		dojo.debug("adding selectedDate");
78
		dojo.html.addClass(this.clickedNode, this.classNames.selectedDate);
79
		this.selectedNode = this.clickedNode;
80
	} else {
81
		this._preInitUI(this.value, false, true);
82
	}
83
	this.clickedNode = null;
84
	this.onValueChanged(this.value);
85
}, _preInitUI:function (dateObj, initFirst, initUI) {
86
	if (typeof (this.startDate) == "string") {
87
		this.startDate = dojo.date.fromRfc3339(this.startDate);
88
	}
89
	if (typeof (this.endDate) == "string") {
90
		this.endDate = dojo.date.fromRfc3339(this.endDate);
91
	}
92
	this.startDate.setHours(0, 0, 0, 0);
93
	this.endDate.setHours(24, 0, 0, -1);
94
	if (dateObj < this.startDate || dateObj > this.endDate) {
95
		dateObj = new Date((dateObj < this.startDate) ? this.startDate : this.endDate);
96
	}
97
	this.firstDay = this._initFirstDay(dateObj, initFirst);
98
	this.selectedIsUsed = false;
99
	this.currentIsUsed = false;
100
	var nextDate = new Date(this.firstDay);
101
	var tmpMonth = nextDate.getMonth();
102
	this.curMonth = new Date(nextDate);
103
	this.curMonth.setDate(nextDate.getDate() + 6);
104
	this.curMonth.setDate(1);
105
	if (this.displayWeeks == "" || this.adjustWeeks) {
106
		this.adjustWeeks = true;
107
		this.displayWeeks = Math.ceil((dojo.date.getDaysInMonth(this.curMonth) + this._getAdjustedDay(this.curMonth)) / 7);
108
	}
109
	var days = this.displayWeeks * 7;
110
	if (dojo.date.diff(this.startDate, this.endDate, dojo.date.dateParts.DAY) < days) {
111
		this.staticDisplay = true;
112
		if (dojo.date.diff(nextDate, this.endDate, dojo.date.dateParts.DAY) > days) {
113
			this._preInitUI(this.startDate, true, false);
114
			nextDate = new Date(this.firstDay);
115
		}
116
		this.curMonth = new Date(nextDate);
117
		this.curMonth.setDate(nextDate.getDate() + 6);
118
		this.curMonth.setDate(1);
119
		var curClass = (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "previous";
120
	}
121
	if (initUI) {
122
		this._initUI(days);
123
	}
124
}, _initUI:function (days) {
125
	dojo.dom.removeChildren(this.calendarDatesContainerNode);
126
	for (var i = 0; i < this.displayWeeks; i++) {
127
		this.calendarDatesContainerNode.appendChild(this.weekTemplate.cloneNode(true));
128
	}
129
	var nextDate = new Date(this.firstDay);
130
	this._setMonthLabel(this.curMonth.getMonth());
131
	this._setYearLabels(this.curMonth.getFullYear());
132
	var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
133
	var calendarRows = this.calendarDatesContainerNode.getElementsByTagName("tr");
134
	var currentCalendarNode;
135
	for (i = 0; i < days; i++) {
136
		currentCalendarNode = calendarNodes.item(i);
137
		currentCalendarNode.innerHTML = nextDate.getDate();
138
		currentCalendarNode.setAttribute("djDateValue", nextDate.valueOf());
139
		var curClass = (nextDate.getMonth() != this.curMonth.getMonth() && Number(nextDate) < Number(this.curMonth)) ? "previous" : (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "next";
140
		var mappedClass = curClass;
141
		if (this._isDisabledDate(nextDate)) {
142
			var classMap = {previous:"disabledPrevious", current:"disabledCurrent", next:"disabledNext"};
143
			mappedClass = classMap[curClass];
144
		}
145
		dojo.html.setClass(currentCalendarNode, this._getDateClassName(nextDate, mappedClass));
146
		if (dojo.html.hasClass(currentCalendarNode, this.classNames.selectedDate)) {
147
			this.selectedNode = currentCalendarNode;
148
		}
149
		nextDate = dojo.date.add(nextDate, dojo.date.dateParts.DAY, 1);
150
	}
151
	this.lastDay = dojo.date.add(nextDate, dojo.date.dateParts.DAY, -1);
152
	this._initControls();
153
}, _initControls:function () {
154
	var d = this.firstDay;
155
	var d2 = this.lastDay;
156
	var decWeek, incWeek, decMonth, incMonth, decYear, incYear;
157
	decWeek = incWeek = decMonth = incMonth = decYear = incYear = !this.staticDisplay;
158
	with (dojo.date.dateParts) {
159
		var add = dojo.date.add;
160
		if (decWeek && add(d, DAY, (-1 * (this._getAdjustedDay(d) + 1))) < this.startDate) {
161
			decWeek = decMonth = decYear = false;
162
		}
163
		if (incWeek && d2 > this.endDate) {
164
			incWeek = incMonth = incYear = false;
165
		}
166
		if (decMonth && add(d, DAY, -1) < this.startDate) {
167
			decMonth = decYear = false;
168
		}
169
		if (incMonth && add(d2, DAY, 1) > this.endDate) {
170
			incMonth = incYear = false;
171
		}
172
		if (decYear && add(d2, YEAR, -1) < this.startDate) {
173
			decYear = false;
174
		}
175
		if (incYear && add(d, YEAR, 1) > this.endDate) {
176
			incYear = false;
177
		}
178
	}
179
	function enableControl(node, enabled) {
180
		dojo.html.setVisibility(node, enabled ? "" : "hidden");
181
	}
182
	enableControl(this.decreaseWeekNode, decWeek);
183
	enableControl(this.increaseWeekNode, incWeek);
184
	enableControl(this.decreaseMonthNode, decMonth);
185
	enableControl(this.increaseMonthNode, incMonth);
186
	enableControl(this.previousYearLabelNode, decYear);
187
	enableControl(this.nextYearLabelNode, incYear);
188
}, _incrementWeek:function (evt) {
189
	var d = new Date(this.firstDay);
190
	switch (evt.target) {
191
	  case this.increaseWeekNode.getElementsByTagName("img").item(0):
192
	  case this.increaseWeekNode:
193
		var tmpDate = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
194
		if (tmpDate < this.endDate) {
195
			d = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
196
		}
197
		break;
198
	  case this.decreaseWeekNode.getElementsByTagName("img").item(0):
199
	  case this.decreaseWeekNode:
200
		if (d >= this.startDate) {
201
			d = dojo.date.add(d, dojo.date.dateParts.WEEK, -1);
202
		}
203
		break;
204
	}
205
	this._preInitUI(d, true, true);
206
}, _incrementMonth:function (evt) {
207
	var d = new Date(this.curMonth);
208
	var tmpDate = new Date(this.firstDay);
209
	switch (evt.currentTarget) {
210
	  case this.increaseMonthNode.getElementsByTagName("img").item(0):
211
	  case this.increaseMonthNode:
212
		tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.DAY, this.displayWeeks * 7);
213
		if (tmpDate < this.endDate) {
214
			d = dojo.date.add(d, dojo.date.dateParts.MONTH, 1);
215
		} else {
216
			var revertToEndDate = true;
217
		}
218
		break;
219
	  case this.decreaseMonthNode.getElementsByTagName("img").item(0):
220
	  case this.decreaseMonthNode:
221
		if (tmpDate > this.startDate) {
222
			d = dojo.date.add(d, dojo.date.dateParts.MONTH, -1);
223
		} else {
224
			var revertToStartDate = true;
225
		}
226
		break;
227
	}
228
	if (revertToStartDate) {
229
		d = new Date(this.startDate);
230
	} else {
231
		if (revertToEndDate) {
232
			d = new Date(this.endDate);
233
		}
234
	}
235
	this._preInitUI(d, false, true);
236
}, _incrementYear:function (evt) {
237
	var year = this.curMonth.getFullYear();
238
	var tmpDate = new Date(this.firstDay);
239
	switch (evt.target) {
240
	  case this.nextYearLabelNode:
241
		tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, 1);
242
		if (tmpDate < this.endDate) {
243
			year++;
244
		} else {
245
			var revertToEndDate = true;
246
		}
247
		break;
248
	  case this.previousYearLabelNode:
249
		tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, -1);
250
		if (tmpDate > this.startDate) {
251
			year--;
252
		} else {
253
			var revertToStartDate = true;
254
		}
255
		break;
256
	}
257
	var d;
258
	if (revertToStartDate) {
259
		d = new Date(this.startDate);
260
	} else {
261
		if (revertToEndDate) {
262
			d = new Date(this.endDate);
263
		} else {
264
			d = new Date(year, this.curMonth.getMonth(), 1);
265
		}
266
	}
267
	this._preInitUI(d, false, true);
268
}, onIncrementWeek:function (evt) {
269
	evt.stopPropagation();
270
	if (!this.staticDisplay) {
271
		this._incrementWeek(evt);
272
	}
273
}, onIncrementMonth:function (evt) {
274
	evt.stopPropagation();
275
	if (!this.staticDisplay) {
276
		this._incrementMonth(evt);
277
	}
278
}, onIncrementYear:function (evt) {
279
	evt.stopPropagation();
280
	if (!this.staticDisplay) {
281
		this._incrementYear(evt);
282
	}
283
}, _setMonthLabel:function (monthIndex) {
284
	this.monthLabelNode.innerHTML = dojo.date.getNames("months", "wide", "standAlone", this.lang)[monthIndex];
285
}, _setYearLabels:function (year) {
286
	var y = year - 1;
287
	var that = this;
288
	function f(n) {
289
		that[n + "YearLabelNode"].innerHTML = dojo.date.format(new Date(y++, 0), {formatLength:"yearOnly", locale:that.lang});
290
	}
291
	f("previous");
292
	f("current");
293
	f("next");
294
}, _getDateClassName:function (date, monthState) {
295
	var currentClassName = this.classNames[monthState];
296
	if ((!this.selectedIsUsed && this.value) && (Number(date) == Number(this.value))) {
297
		currentClassName = this.classNames.selectedDate + " " + currentClassName;
298
		this.selectedIsUsed = true;
299
	}
300
	if ((!this.currentIsUsed) && (Number(date) == Number(this.today))) {
301
		currentClassName = currentClassName + " " + this.classNames.currentDate;
302
		this.currentIsUsed = true;
303
	}
304
	return currentClassName;
305
}, onClick:function (evt) {
306
	dojo.event.browser.stopEvent(evt);
307
}, _handleUiClick:function (evt) {
308
	var eventTarget = evt.target;
309
	if (eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {
310
		eventTarget = eventTarget.parentNode;
311
	}
312
	dojo.event.browser.stopEvent(evt);
313
	this.selectedIsUsed = this.todayIsUsed = false;
314
	if (dojo.html.hasClass(eventTarget, this.classNames["disabledPrevious"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledCurrent"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledNext"])) {
315
		return;
316
	}
317
	this.clickedNode = eventTarget;
318
	this.setDate(new Date(Number(dojo.html.getAttribute(eventTarget, "djDateValue"))));
319
}, onValueChanged:function (date) {
320
}, _isDisabledDate:function (dateObj) {
321
	if (dateObj < this.startDate || dateObj > this.endDate) {
322
		return true;
323
	}
324
	return this.isDisabledDate(dateObj, this.lang);
325
}, isDisabledDate:function (dateObj, locale) {
326
	return false;
327
}, _initFirstDay:function (dateObj, adj) {
328
	var d = new Date(dateObj);
329
	if (!adj) {
330
		d.setDate(1);
331
	}
332
	d.setDate(d.getDate() - this._getAdjustedDay(d, this.weekStartsOn));
333
	d.setHours(0, 0, 0, 0);
334
	return d;
335
}, _getAdjustedDay:function (dateObj) {
336
	var days = [0, 1, 2, 3, 4, 5, 6];
337
	if (this.weekStartsOn > 0) {
338
		for (var i = 0; i < this.weekStartsOn; i++) {
339
			days.unshift(days.pop());
340
		}
341
	}
342
	return days[dateObj.getDay()];
343
}, destroy:function () {
344
	dojo.widget.DatePicker.superclass.destroy.apply(this, arguments);
345
	dojo.html.destroyNode(this.weekTemplate);
346
}});
347