java万年历小程序代码 java万年历小程序代码大全( 三 )


}
function addYear(obj)//增加年份
{
var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
myObj[0].innerHTML=eval(myObj[0].innerHTML)+1;
dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}
function subMonth(obj)//减小月份
{
var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
var month=eval(myObj[2].innerHTML)-1;
if(month==0)
{
month=12;
subYear(obj);
}
myObj[2].innerHTML=month;
dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}
function addMonth(obj)//增加月份
{
var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
var month=eval(myObj[2].innerHTML)+1;
if(month==13)
{
month=1;
addYear(obj);
}
myObj[2].innerHTML=month;
dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}
function dateShow(obj,year,month)//显示各月份的日
{
var myDate=new Date(year,month-1,1);
var today=new Date();
var day=myDate.getDay();
var selectDate=obj.parentNode.parentNode.previousSibling.previousSibling.value.split('-');
var length;
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
length=31;
break;
case 4:
case 6:
case 9:
case 11:
length=30;
break;
case 2:
【java万年历小程序代码 java万年历小程序代码大全】if((year%4==0)(year%100!=0)||(year%400==0))
length=29;
else
length=28;
}
for(i=0;iobj.cells.length;i++)
{
obj.cells[i].innerHTML='';
obj.cells[i].style.color='';
obj.cells[i].className='';
}
for(i=0;ilength;i++)
{
obj.cells[i+day].innerHTML=(i+1);
if(year==today.getFullYear()(month-1)==today.getMonth()(i+1)==today.getDate())
obj.cells[i+day].style.color='red';
if(year==eval(selectDate[0])month==eval(selectDate[1])(i+1)==eval(selectDate[2]))
obj.cells[i+day].className='ds_border2';
}
}
function getValue(obj,inputObj)//把选择的日期传给输入框
{
var myObj=inputObj.nextSibling.nextSibling.childNodes[0].childNodes[0].cells[2].childNodes;
if(obj.innerHTML)
if(obj.innerHTML.length==1myObj[2].innerHTML.length==1)
inputObj.value=https://www.04ip.com/post/myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-0"+obj.innerHTML;
elseif(obj.innerHTML.length==1myObj[2].innerHTML.length==2)
inputObj.value=https://www.04ip.com/post/myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-0"+obj.innerHTML;
elseif(obj.innerHTML.length==2myObj[2].innerHTML.length==1)
inputObj.value=https://www.04ip.com/post/myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-"+obj.innerHTML;
elseif(obj.innerHTML.length==2myObj[2].innerHTML.length==2)
inputObj.value=https://www.04ip.com/post/myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-"+obj.innerHTML;
inputObj.nextSibling.nextSibling.style.display='none';
for(i=0;iobj.parentNode.parentNode.parentNode.cells.length;i++)
obj.parentNode.parentNode.parentNode.cells[i].className='';
obj.className='ds_border2'
}
function dsMove(obj)//实现层的拖移
{
if(event.button==1)
{
var X=obj.clientLeft;
var Y=obj.clientTop;
obj.style.pixelLeft=X+(event.x-DS_x);
obj.style.pixelTop=Y+(event.y-DS_y);
}
}
/***调用代码**
script language=javascript
var myDate=new dateSelector();
myDate.year=1900;//morenqiri
myDate.inputName='date';//
myDate.display();
/script
*/
求Java 日历的小程序的源代码也不知道java万年历小程序代码你具体需求是什么java万年历小程序代码,以前改过一个日历程序java万年历小程序代码 , 一共四个java类java万年历小程序代码,放在同一个包里 。经测试可以运行 。

推荐阅读