initialize: function(id,options) {
this.id=id;
var today=new Date();
+ this.defaultMin = new Date(today.getFullYear()-50,0,1);
+ this.defaultMax = new Date(today.getFullYear()+50,11,31);
Rico.extend(this, new Rico.Popup());
Rico.extend(this.options, {
ignoreClicks:true,
showWeekNumber : 0,
showToday : 1,
dateFmt : 'ISO8601',
- minDate : new Date(today.getFullYear()-50,0,1),
- maxDate : new Date(today.getFullYear()+50,11,31)
+ minDate : this.defaultMin,
+ maxDate : this.defaultMax
});
Rico.extend(this.options, options || {});
/**
this.yearPopup=new Rico.Popup(document.createElement("div"),{shim:false,zIndex:10});
this.yearPopup.content.className='ricoCalYearPrompt';
if (Rico.theme.calendarPopdown) Rico.addClass(this.yearPopup.content,Rico.theme.calendarPopdown);
- var p1=document.createElement("p");
- p1.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
+ this.yearPrompt=document.createElement("p");
+ this.yearPrompt.innerHTML=" ";
var p2=document.createElement("p");
this.yearInput=p2.appendChild(document.createElement("input"));
this.yearInput.maxlength=4;
p2.appendChild(a);
a=Rico.floatButton('Cancel', Rico.eventHandle(this,'popDownYear'));
p2.appendChild(a);
- this.yearPopup.content.appendChild(p1);
+ this.yearPopup.content.appendChild(this.yearPrompt);
this.yearPopup.content.appendChild(p2);
this.container.appendChild(this.yearPopup.container);
this.yearPopup.closePopup();
return false;
}
this.popDownMonth();
+ this.yearPrompt.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
this.yearInput.disabled=false;
this.yearInput.value=''; // this.yearSelected
this.openYrMo(this.yearPopup,1);
}
},
- open : function(curval) {
+ open : function(curval,column) {
if (!this.bPageLoaded) return;
+ if (column) {
+ this.setDateFmt(column.format.dateFmt);
+ this.options.minDate=column.format.min || this.defaultMin;
+ this.options.maxDate=column.format.max || this.defaultMax;
+ }
var today = new Date();
this.dateNow = today.getDate();
this.monthNow = today.getMonth();