* @param {DatePicker} this
* @param {Date} date The selected date
*/
- select: true
+ 'select': true,
+ /**
+ * @event monthchange
+ * Fires when the displayed month changes
+ * @param {DatePicker} this
+ * @param {Date} date The selected month
+ */
+ 'monthchange': true
});
if(this.handler){
var re = "(?:";
for(var i = 0; i < dd.length; i++){
re += dd[i];
- if(i != dd.length-1) re += "|";
+ if(i != dd.length-1) {
+ re += "|";
+ }
}
this.disabledDatesRE = new RegExp(re + ")");
}
*/
setValue : function(value){
var old = this.value;
+
+ if (typeof(value) == 'string') {
+
+ value = Date.parseDate(value, this.format);
+ }
+ if (!value) {
+ value = new Date();
+ }
+
this.value = value.clearTime(true);
if(this.el){
this.update(this.value);
}
},
- // private
+ // privateval
onRender : function(container, position){
+
var m = [
'<table cellspacing="0">',
'<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'"> </a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'"> </a></td></tr>',
},
// private
- update : function(date){
+ update : function(date)
+ {
var vd = this.activeDate;
this.activeDate = date;
if(vd && this.el){
return;
}
}
+
var days = date.getDaysInMonth();
var firstOfMonth = date.getFirstDateOfMonth();
var startingPos = firstOfMonth.getDay()-this.startDay;
}
this.mbtn.setText(this.monthNames[date.getMonth()] + " " + date.getFullYear());
-
+ this.fireEvent('monthchange', this, date);
+
if(!this.internalRender){
var main = this.el.dom.firstChild;
var w = main.offsetWidth;
this.update.defer(10, this, [date]);
}
}
+
+
}
});
\ No newline at end of file