1、JS 时钟汇总 (二)极品万年历极品万年历 0x8; i=1) sum += (lunarInfoy-1900 i0; i+) temp = lYearDays(i)offset -= tempthis.monCyl += 12if(offset0; i+) /闰月if(leap0 this.isLeap = true; temp = leapDays(this.year); else temp = monthDays(this.year, i); /解除闰月if(this.isLeap=true else this.isLeap = true; -i; -this.monCyl;if(off
2、setlX) sDObj = new Date(y,m,i+1) /当月一日日期lDObj = new Lunar(sDObj) /农历lY = lDObj.year /农历年lM = lDObj.month /农历月lD = lDObj.day /农历日lL = lDObj.isLeap /农历是否闰月lX = lL? leapDays(lY): monthDays(lY,lM) /农历当月最後一天if(n=0) firstLM = lMlDPOSn+ = i-lD+1/sYear,sMonth,sDay,week,/lYear,lMonth,lDay,isLeap,/cYear,cMont
3、h,cDaythis = new calElement(y, m+1, i+1, nStr1(i+this.firstWeek)%7,lY, lM, lD+, lL,cyclical(lDObj.yearCyl) ,cyclical(lDObj.monCyl), cyclical(lDObj.dayCyl+) )if(i+this.firstWeek)%7=0) this.color = red /周日颜色if(i+this.firstWeek)%14=13) this.color = red /周休二日颜色/节气tmp1=sTerm(y,m*2 )-1tmp2=sTerm(y,m*2+1)-
4、1thistmp1.solarTerms = solarTermm*2thistmp2.solarTerms = solarTermm*2+1if(m=3) thistmp1.color = red /清明颜色/国历节日for(i in sFtv)if(sFtv.match(/(d2)(d2)(s*)(.+)$/)if(Number(RegExp.$1)=(m+1) thisNumber(RegExp.$2)-1.solarFestival += RegExp.$4 + if(RegExp.$3=*) thisNumber(RegExp.$2)-1.color = red/月周节日for(i
5、in wFtv)if(wFtv.match(/(d2)(d)(d)(s*)(.+)$/)if(Number(RegExp.$1)=(m+1) tmp1=Number(RegExp.$2)tmp2=Number(RegExp.$3)this(this.firstWeektmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstWeek.solarFestival += RegExp.$5 + /农历节日for(i in lFtv)if(lFtv.match(/(d2)(.2)(s*)(.+)$/) tmp1=Number(RegExp.$1)-firstLMif(tm
6、p1=-11) tmp1=1if(tmp1 =0 YMBG.innerHTML = “ “ + SY + “ “ + monthNameSM;for(i=0;i-1 else /显示农历日lObj.innerHTML = cDay(cldsD.lDay);s=cldsD.lunarFestival;if(s.length0) /农历节日if(s.length6) s = s.substr(0, 4)+;s = s.fontcolor(red);else /国历节日s=cldsD.solarFestival;if(s.length0) size = (s.charCodeAt(0)0 s = s
7、.fontcolor(blue);else /廿四节气s=cldsD.solarTerms;if(s.length0) s = s.fontcolor(limegreen);if(s.length0) lObj.innerHTML = s;else /非日期sObj.innerHTML = ;lObj.innerHTML = ;function changeCld() var y,m;y=CLD.SY.selectedIndex+1900;m=CLD.SM.selectedIndex;drawCld(y,m);function pushBtm(K) switch (K)case YU :if(CLD.SY.selectedIndex0) CLD.SY.selectedIndex-;break;case YD :if(CLD.SY.selectedIndex0) CLD.SM.selectedIndex-;else CLD.SM.selectedIndex=11;if(CLD.SY.selectedIndex0) CLD.SY.selectedIndex-;break;case MD :