define("chy/widget/Calendar", ["dojo/_base/declare","dojox/widget/Calendar","dojo/date/stamp"],function(declare,Calendar,stamp){
	return declare("chy.widget.Calendar", Calendar, {
		
		_setValueAttr: function(/*Date*/ value){
			// summary:
			//		Set the current date and update the UI.	If the date is disabled, the selection will
			//		not change, but the display will change to the corresponding month.
			if (!value){
				return true;	
			}
			if(!value["getFullYear"]){
				value = stamp.fromISOString(value + "");
			}
			if(this._isInvalidDate(value)){
				return false;
			}
			console.log("b4 new Date");
			value = new Date(value);
			this.displayMonth = new Date(value);
			this._internalValue = value;
			if(!this.isDisabledDate(value, this.lang) && this._currentChild == 0){
				this.value = value;
				this.onChange(value);
			}
			if (this._children && this._children.length > 0) {
				this._children[this._currentChild].set("value", this.value);
			}
			return true;
		}

	});
});