日期:2014-05-18  浏览次数:20460 次

有没有代码简单清晰的 日期选择控件??
有没有代码简单清晰的   日期选择控件??

------解决方案--------------------
timesheet/////////////////////////////////////////////////////
function caleTDMove(e){e.style.borderColor= "#ffffff #333333 #333333 #ffffff "}
function caleTDOut(e){e.style.border= "solid 1pt #EAF2FF "}
function hideCale(){popCale.hide()}
function yearChange(){
var e=popCale.document.all( 'yearSel ')
e.options.length=0
for (i=nYear-4;i <parseInt(nYear)+5;i++){
e.options.length++
e.options[e.options.length - 1].value=i
e.options[e.options.length - 1].text=i
}
e.selectedIndex=4
}
function CaleClick(e){
if(isNaN(parseInt(e.innerText))){
var d=new Date()
tarObject.value=d.getFullYear()+ '- '+(d.getMonth()+1)+ '- '+d.getDate()
e.style.borderColor= "#78ACFF "
}
else{tarObject.value=nYear+ '- '+(parseInt(nMonth)+1)+ '- '+e.innerText
e.style.borderColor= "#EAF2FF "
}
popCale.hide()
}
function changeYM(e,n){
if (e.tagName== 'SELECT '){
if(e.value.length==4){nYear=e.value;yearChange()}
else{nMonth=e.value}
}
else{nMonth=parseInt(nMonth)+n
switch(nMonth){
case 12:nYear++;nMonth=0;
yearChange()
popCale.document.all( 'monthSel ').selectedIndex=0;break;
case -1:nYear--;nMonth=11;
yearChange()
popCale.document.all( 'monthSel ').selectedIndex=11;break;
default:popCale.document.all( 'monthSel ').selectedIndex=nMonth;break;
}
}
rewriteCale()
}