calendar-debug.js revision bb870be438ad84a9744d621c0173654ef6e07f95
b2f520df12990a4f0c393c2fb9b6f9b1449aef70Dav Glass * The Calendar component is a UI widget that allows users
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass * to view dates in a two-dimensional month grid, as well as
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass * to select one or more dates, or ranges of dates. Calendar
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass * is generated dynamically and relies on the developer to
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass * provide for a progressive enhancement alternative.
b2f520df12990a4f0c393c2fb9b6f9b1449aef70Dav Glass * @module calendar
b2f520df12990a4f0c393c2fb9b6f9b1449aef70Dav Glass CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),
c0d83403b13f02bc6fdcf62a712de150a7f974e2Dav Glass CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),
_keyEvents: [],
_highlightedDateNode: null,
_lastSelectedDate: null,
initializer : function () {
this._keyEvents = [];
this._highlightedDateNode = null;
this._lastSelectedDate = null;
syncUI : function () {
_bindCalendarEvents : function () {
this._unhighlightCurrentDateNode();
_unhighlightCurrentDateNode : function () {
if (this._highlightedDateNode) {
this._unhighlightCurrentDateNode();
this._unhighlightCurrentDateNode();
this._highlightedDateNode = null;
switch(keyCode) {
case KEY_DOWN:
case KEY_UP:
case KEY_LEFT:
case KEY_RIGHT:
if (this._highlightedDateNode) {
this._clearSelection(true);
if (curDate == null) {
if (clickedCellIsDay) {
if (!clickedCellIsSelected) {
this._clearSelection(true);
if (clickedCellIsDay) {
if (clickedCellIsSelected) {
this._clearSelection(true);
else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {
if (clickedCellIsSelected) {
this._lastSelectedDate = null;
if (this._lastSelectedDate != null) {
if (this._lastSelectedDate != null) {
this._clearSelection(true);
this._clearSelection(true);
if (clickedCellIsDay) {
subtractMonth : function (e) {
e.halt();
subtractYear : function (e) {
e.halt();
addMonth : function (e) {
e.halt();
addYear : function (e) {
e.halt();
ATTRS: {
date: {
value: new Date(),
lazyAdd: false,
return newDate;
return minDate;
return actualMaxDate;
minimumDate: {
value: null,
if (val != null) {
return newMinDate;
maximumDate: {
value: null,
if (val != null) {
if (curDate!= null && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {
return newMaxDate;
return val;