this.year = i;
leap = leapMonth(i); //闰哪个月
this.isLeap = false;
for(i=1; i<13 && offset>0; i++) {
//闰月
if(leap>0 && i==(leap+1) && this.isLeap==false)
{ –i; this.isLeap = true; temp = leapDays(this.year); }
else
{ temp = monthDays(this.year, i); }
//解除闰月
if(this.isLeap==true && i==(leap+1)) this.isLeap = false;
offset -= temp;
}
if(offset==0 && leap>0 && i==leap+1)
if(this.isLeap)
{ this.isLeap = false; }
else
{ this.isLeap = true; –i; }
if(offset<0){ offset += temp; –i; }
this.month = i;
this.day = offset + 1;
}
//==============================传回国历 y 年某 m+1 月的天数
function solarDays(y,m) {
if(m==1)
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
else
return(solarMonth[m]);
}
//============================== 传入 offset 传回干支, 0=甲子
function cyclical(num) {
return(Gan[num%10]+Zhi[num%12]);
}
//============================== 月历属性
function
精通 CSS+DIV 网页样式与布局 164
最新推荐文章于 2020-08-08 15:16:56 发布