当前位置:   article > 正文

Hexo Landscape博客添加【农历日历】

hexo添加节日按钮

效果见:我的个人网站 的右下角

 

第一步,在主题目录配置下打开 themes\landscape\layout\_widget

新建 calender.ejs 文件,

代码太长,所有在本文最后附上。

注:为了避免代码在Hexo渲染时中文字符乱码,此 .ejs 内容均为已经转码后的代码,特此说明!

 

 

第二步,在主题目录配置下 themes\landscape\ 打开 _config.yml 文件,

在 widgets: 中添加 - calendar 即可。

 

 

第三步,在Hexo根目录配置下鼠标右键 git bash 运行 "hexo g -d" 即可在个人网站查看效果。

 

 

附: calender.ejs 文件代码(已转码)

  1. <div class="widget-wrap">
  2. <h3 class="widget-title">&#x65E5;&#x5386;&#x5C0F;&#x5DE5;&#x5177;</h3>
  3. <ul class="widget calendar">
  4. <!-- 以下是含农历日历代码-->
  5. <body>
  6. <SCRIPT type="text/javascript" >
  7. var lunarInfo=new Array(0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0)
  8. var solarMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
  9. var Gan=new Array("&#x7532;","&#x4E59;","&#x4E19;","&#x4E01;","&#x620A;","&#x5DF1;","&#x5E9A;","&#x8F9B;","&#x58EC;","&#x7678;");
  10. var Zhi=new Array("&#x5B50;","&#x4E11;","&#x5BC5;","&#x536F;","&#x8FB0;","&#x5DF3;","&#x5348;","&#x672A;","&#x7533;","&#x9149;","&#x620C;","&#x4EA5;");
  11. var Animals=new Array("&#x9F20;","&#x725B;","&#x864E;","&#x5154;","&#x9F99;","&#x86C7;","&#x9A6C;","&#x7F8A;","&#x7334;","&#x9E21;","&#x72D7;","&#x732A;");
  12. var solarTerm = new Array("&#x5C0F;&#x5BD2;","&#x5927;&#x5BD2;","&#x7ACB;&#x6625;","&#x96E8;&#x6C34;","&#x60CA;&#x86F0;","&#x6625;&#x5206;","&#x6E05;&#x660E;","&#x8C37;&#x96E8;","&#x7ACB;&#x590F;","&#x5C0F;&#x6EE1;","&#x8292;&#x79CD;","&#x590F;&#x81F3;","&#x5C0F;&#x6691;","&#x5927;&#x6691;","&#x7ACB;&#x79CB;","&#x5904;&#x6691;","&#x767D;&#x9732;","&#x79CB;&#x5206;","&#x5BD2;&#x9732;","&#x971C;&#x964D;","&#x7ACB;&#x51AC;","&#x5C0F;&#x96EA;","&#x5927;&#x96EA;","&#x51AC;&#x81F3;")
  13. var sTermInfo = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758)
  14. var nStr1 = new Array('&#x65E5;','&#x4E00;','&#x4E8C;','&#x4E09;','&#x56DB;','&#x4E94;','&#x516D;','&#x4E03;','&#x516B;','&#x4E5D;','&#x5341;')
  15. var nStr2 = new Array('&#x521D;','&#x5341;','&#x5EFF;','&#x5345;','&#x3000;')
  16. var monthName = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
  17. var sFtv = new Array( "0101*&#x5143;&#x65E6;", "0214 &#x60C5;&#x4EBA;&#x8282;", "0303 &#x6211;&#x751F;&#x65E5;", "0308 &#x5987;&#x5973;&#x8282;", "0312 &#x690D;&#x6811;&#x8282;", "0315 &#x6D88;&#x8D39;&#x8005;&#x6743;&#x76CA;&#x65E5;", "0317 St. Patrick's", "0401 &#x611A;&#x4EBA;&#x8282;", "0501 &#x52B3;&#x52A8;&#x8282;", "0504 &#x9752;&#x5E74;&#x8282;", "0512 &#x62A4;&#x58EB;&#x8282;", "0512 &#x8335;&#x751F;&#x65E5;", "0601 &#x513F;&#x7AE5;&#x8282;", "0614 Flag Day", "0701 &#x5EFA;&#x515A;&#x8282; &#x9999;&#x6E2F;&#x56DE;&#x5F52;&#x7EAA;&#x5FF5;", "0703 &#x708E;&#x9EC4;&#x5728;&#x7EBF;&#x8BDE;&#x8FB0;", "0718 &#x6258;&#x666E;&#x8BDE;&#x8FB0;", "0801 &#x5EFA;&#x519B;&#x8282;", "0808 &#x7236;&#x4EB2;&#x8282;", "0909 &#x6BDB;&#x6CFD;&#x4E1C;&#x901D;&#x4E16;&#x7EAA;&#x5FF5;","0910 &#x6559;&#x5E08;&#x8282;", "0928 &#x5B54;&#x5B50;&#x8BDE;&#x8FB0;", "1001*&#x56FD;&#x5E86;&#x8282;", "1006 &#x8001;&#x4EBA;&#x8282;","1024 &#x8054;&#x5408;&#x56FD;&#x65E5;","1111 Veteran's / Remembrance Day","1112 &#x5B59;&#x4E2D;&#x5C71;&#x8BDE;&#x8FB0;&#x7EAA;&#x5FF5;", "1220 &#x6FB3;&#x95E8;&#x56DE;&#x5F52;&#x7EAA;&#x5FF5;", "1225 Christmas Day","1226 &#x6BDB;&#x6CFD;&#x4E1C;&#x8BDE;&#x8FB0;&#x7EAA;&#x5FF5;")
  18. var lFtv = new Array( "0101*&#x6625;&#x8282;", "0115 &#x5143;&#x5BB5;&#x8282;", "0505 &#x7AEF;&#x5348;&#x8282;", "0707 &#x4E03;&#x5915;&#x60C5;&#x4EBA;&#x8282;", "0715 &#x4E2D;&#x5143;&#x8282;","0815 &#x4E2D;&#x79CB;&#x8282;", "0909 &#x91CD;&#x9633;&#x8282;", "1208 &#x814A;&#x516B;&#x8282;", "1224 &#x5C0F;&#x5E74;", "0100*&#x9664;&#x5915;")
  19. var wFtv = new Array( "0131 Martin Luther King Day", "0231 President's Day", "0520 &#x6BCD;&#x4EB2;&#x8282;", "0530 Armed Forces Day", "0531 Victoria Day", "0716 &#x5408;&#x4F5C;&#x8282;", "0730 &#x88AB;&#x5974;&#x5F79;&#x56FD;&#x5BB6;&#x5468;", "0811 Civic Holiday", "0911 Labor Holiday", "1021 Columbus Day", "1144 Thanksgiving")
  20. function lYearDays(y) {
  21. var I, sum = 348
  22. for(I=0x8000; I>0x8; I>>=1) sum += (lunarInfo[y-1900] & I)? 1: 0
  23. return(sum+leapDays(y))
  24. }
  25. function leapDays(y) {
  26. if(leapMonth(y)) return((lunarInfo[y-1900] & 0x10000)? 30: 29)
  27. else return(0)
  28. }
  29. function leapMonth(y) {
  30. return(lunarInfo[y-1900] & 0xf)
  31. }
  32. function monthDays(y,m) {
  33. return( (lunarInfo[y-1900] & (0x10000>>m))? 30: 29 )
  34. }
  35. function Lunar(objDate) {
  36. var I, leap=0, temp=0
  37. var baseDate = new Date(1900,0,31)
  38. var offset = (objDate - baseDate)/86400000
  39. this.dayCyl = offset + 40
  40. this.monCyl = 14
  41. for(I=1900; I<2050 && offset>0; I++) {
  42. temp = lYearDays(I)
  43. offset -= temp
  44. this.monCyl += 12
  45. }
  46. if(offset<0) {
  47. offset += temp;
  48. I--;
  49. this.monCyl -= 12
  50. }
  51. this.year = I
  52. this.yearCyl = I-1864
  53. leap = leapMonth(I)
  54. this.isLeap = false
  55. for(I=1; I<13 && offset>0; I++) {
  56. if(leap>0 && I==(leap+1) && this.isLeap==false)
  57. { --I; this.isLeap = true; temp = leapDays(this.year); }
  58. else
  59. { temp = monthDays(this.year, I); }
  60. if(this.isLeap==true && I==(leap+1)) this.isLeap = false
  61. offset -= temp
  62. if(this.isLeap == false) this.monCyl ++
  63. }
  64. if(offset==0 && leap>0 && I==leap+1)
  65. if(this.isLeap)
  66. { this.isLeap = false; }
  67. else
  68. { this.isLeap = true; --I; --this.monCyl;}
  69. if(offset<0){ offset += temp; --I; --this.monCyl; }
  70. this.month = I
  71. this.day = offset + 1
  72. }
  73. function solarDays(y,m) {
  74. if(m==1)
  75. return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28)
  76. else
  77. return(solarMonth[m])
  78. }
  79. function cyclical(num) {
  80. return(Gan[num%10]+Zhi[num%12])
  81. }
  82. function calElement(sYear,sMonth,sDay,week,lYear,lMonth,lDay,isLeap,cYear,cMonth,cDay) {
  83. this.isToday = false;
  84. this.sYear = sYear;
  85. this.sMonth = sMonth;
  86. this.sDay = sDay;
  87. this.week = week;
  88. this.lYear = lYear;
  89. this.lMonth = lMonth;
  90. this.lDay = lDay;
  91. this.isLeap = isLeap;
  92. this.cYear = cYear;
  93. this.cMonth = cMonth;
  94. this.cDay = cDay;
  95. this.color = '';
  96. this.lunarFestival = '';
  97. this.solarFestival = '';
  98. this.solarTerms = '';
  99. }
  100. function sTerm(y,n) {
  101. var offDate = new Date( ( 31556925974.7*(y-1900) + sTermInfo[n]*60000 ) + Date.UTC(1900,0,6,2,5) )
  102. return(offDate.getUTCDate())
  103. }
  104. function calendar(y,m) {
  105. var sDObj, lDObj, lY, lM, lD=1, lL, lX=0, tmp1, tmp2
  106. var lDPOS = new Array(3)
  107. var n = 0
  108. var firstLM = 0
  109. sDObj = new Date(y,m,1)
  110. this.length = solarDays(y,m)
  111. this.firstWeek = sDObj.getDay()
  112. for(var I=0;I<this.length;I++) {
  113. if(lD>lX) {
  114. sDObj = new Date(y,m,I+1)
  115. lDObj = new Lunar(sDObj)
  116. lY = lDObj.year
  117. lM = lDObj.month
  118. lD = lDObj.day
  119. lL = lDObj.isLeap
  120. lX = lL? leapDays(lY): monthDays(lY,lM)
  121. if(n==0) firstLM = lM
  122. lDPOS[n++] = I-lD+1
  123. }
  124. this[I] = new calElement(y, m+1, I+1, nStr1[(I+this.firstWeek)%7],
  125. lY, lM, lD++, lL,
  126. cyclical(lDObj.yearCyl) ,cyclical(lDObj.monCyl), cyclical(lDObj.dayCyl++) )
  127. if((I+this.firstWeek)%7==0) this[I].color = 'red'
  128. if((I+this.firstWeek)%14==13) this[I].color = 'red'
  129. }
  130. tmp1=sTerm(y,m*2 )-1
  131. tmp2=sTerm(y,m*2+1)-1
  132. this[tmp1].solarTerms = solarTerm[m*2]
  133. this[tmp2].solarTerms = solarTerm[m*2+1]
  134. if(m==3) this[tmp1].color = 'red'
  135. for(I in sFtv)
  136. if(sFtv[I].match(/^(d{2})(d{2})([s*])(.+)$/))
  137. if(Number(RegExp.$1)==(m+1)) {
  138. this[Number(RegExp.$2)-1].solarFestival += RegExp.$4 + ' '
  139. if(RegExp.$3=='*') this[Number(RegExp.$2)-1].color = 'red'
  140. }
  141. for(I in wFtv)
  142. if(wFtv[I].match(/^(d{2})(d)(d)([s*])(.+)$/))
  143. if(Number(RegExp.$1)==(m+1)) {
  144. tmp1=Number(RegExp.$2)
  145. tmp2=Number(RegExp.$3)
  146. this[((this.firstWeek>tmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstWeek].solarFestival += RegExp.$5 + ' '
  147. }
  148. for(I in lFtv)
  149. if(lFtv[I].match(/^(d{2})(.{2})([s*])(.+)$/)) {
  150. tmp1=Number(RegExp.$1)-firstLM
  151. if(tmp1==-11) tmp1=1
  152. if(tmp1 >=0 && tmp1<n) {
  153. tmp2 = lDPOS[tmp1] + Number(RegExp.$2) -1
  154. if( tmp2 >= 0 && tmp2<this.length) {
  155. this[tmp2].lunarFestival += RegExp.$4 + ' '
  156. if(RegExp.$3=='*') this[tmp2].color = 'red'
  157. }
  158. }
  159. }
  160. if((this.firstWeek+12)%7==5)
  161. this[12].solarFestival += '&#x9ED1;&#x8272;&#x661F;&#x671F;&#x4E94; '
  162. if(y==tY && m==tM) this[tD-1].isToday = true;
  163. }
  164. function cDay(d){
  165. var s;
  166. switch (d) {
  167. case 10:
  168. s = '&#x521D;&#x5341;'; break;
  169. case 20:
  170. s = '&#x4E8C;&#x5341;'; break;
  171. break;
  172. case 30:
  173. s = '&#x4E09;&#x5341;'; break;
  174. break;
  175. default :
  176. s = nStr2[Math.floor(d/10)];
  177. s += nStr1[d%10];
  178. }
  179. return(s);
  180. }
  181. var cld;
  182. function drawCld(SY,SM) {
  183. var I,sD,s,size;
  184. cld = new calendar(SY,SM);
  185. if(SY>1874 && SY<1909) yDisplay = '&#x5149;&#x7EEA;' + (((SY-1874)==1)?'&#x5143;':SY-1874)
  186. if(SY>1908 && SY<1912) yDisplay = '&#x5BA3;&#x7EDF;' + (((SY-1908)==1)?'&#x5143;':SY-1908)
  187. if(SY>1911 && SY<1950) yDisplay = '&#x6C11;&#x56FD;' + (((SY-1911)==1)?'&#x5143;':SY-1911)
  188. if(SY>1949) yDisplay = ''
  189. GZ.innerHTML = yDisplay +' &#x519C;&#x5386;' + cyclical(SY-1900+36) + '&#x5E74; ['+Animals[(SY-4)%12]+'&#x5E74;]';
  190. YMBG.innerHTML = " " + SY + "<BR> " + monthName[SM];
  191. for(I=0;I<42;I++) {
  192. sObj=eval('SD'+ I);
  193. lObj=eval('LD'+ I);
  194. sObj.className = '';
  195. sD = I - cld.firstWeek;
  196. if(sD>-1 && sD<cld.length) {
  197. sObj.innerHTML = sD+1;
  198. if(cld[sD].isToday) sObj.className = 'todyaColor';
  199. sObj.style.color = cld[sD].color;
  200. if(cld[sD].lDay==1)
  201. lObj.innerHTML = '<b>'+(cld[sD].isLeap?'&#x95F0;':'') + cld[sD].lMonth + '&#x6708;' + (monthDays(cld[sD].lYear,cld[sD].lMonth)==29?'&#x5C0F;':'&#x5927;')+'</b>';
  202. else
  203. lObj.innerHTML = cDay(cld[sD].lDay);
  204. s=cld[sD].lunarFestival;
  205. if(s.length>0) {
  206. if(s.length>6) s = s.substr(0, 4)+'…';
  207. s = s.fontcolor('red');
  208. }
  209. else {
  210. s=cld[sD].solarFestival;
  211. if(s.length>0) {
  212. size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4;
  213. if(s.length>size+2) s = s.substr(0, size)+'…';
  214. s = s.fontcolor('blue');
  215. }
  216. else {
  217. s=cld[sD].solarTerms;
  218. if(s.length>0) s = s.fontcolor('limegreen');
  219. }
  220. }
  221. if(s.length>0) lObj.innerHTML = s;
  222. }
  223. else {
  224. sObj.innerHTML = '';
  225. lObj.innerHTML = '';
  226. }
  227. }
  228. }
  229. function changeLong()
  230. {
  231. var y,m,ly,lm,id,im,iy,yangy,yangm,deltm,miny,tt;
  232. CLD.SY.selectedIndex=CLD.D1.selectedIndex;
  233. CLD.SM.selectedIndex=CLD.D2.selectedIndex;
  234. yangm=0;yangy=0;
  235. tt=true;
  236. while (tt)
  237. {
  238. yangm=0;yangy=0;
  239. changeCld();
  240. for(I=0;I<42;I++)
  241. {
  242. sD = I - cld.firstWeek;
  243. if(sD>-1 && sD<cld.length)
  244. {
  245. if ((cld[sD].lMonth==CLD.D2.selectedIndex+1)&&(cld[sD].lYear==CLD.D1.selectedIndex+1900))
  246. {
  247. yangy=CLD.SY.selectedIndex+1900; yangm=CLD.SM.selectedIndex ;
  248. tt=false;
  249. break;
  250. }
  251. }
  252. }
  253. if (!tt) break;
  254. pushBtm('MD');
  255. changeCld();
  256. for(I=0;I<42;I++)
  257. {
  258. sD = I - cld.firstWeek;
  259. if(sD>-1 && sD<cld.length)
  260. {
  261. if ((cld[sD].lMonth==CLD.D2.selectedIndex+1)&&(cld[sD].lYear==CLD.D1.selectedIndex+1900))
  262. {
  263. yangy=CLD.SY.selectedIndex+1900; yangm=CLD.SM.selectedIndex ;
  264. tt=false;
  265. break;
  266. }
  267. }
  268. }
  269. break;
  270. }
  271. CLD.SM.selectedIndex=yangm;
  272. pushBtm('MD');
  273. pushBtm('MU');
  274. }
  275. function changeCld() {
  276. var y,m;
  277. y=CLD.SY.selectedIndex+1900;
  278. m=CLD.SM.selectedIndex;
  279. drawCld(y,m);
  280. }
  281. function pushBtm(K) {
  282. switch (K){
  283. case 'YU' :
  284. if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;
  285. break;
  286. case 'YD' :
  287. if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;
  288. break;
  289. case 'MU' :
  290. if(CLD.SM.selectedIndex>0) {
  291. CLD.SM.selectedIndex--;
  292. }
  293. else {
  294. CLD.SM.selectedIndex=11;
  295. if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;
  296. }
  297. break;
  298. case 'MD' :
  299. if(CLD.SM.selectedIndex<11) {
  300. CLD.SM.selectedIndex++;
  301. }
  302. else {
  303. CLD.SM.selectedIndex=0;
  304. if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;
  305. }
  306. break;
  307. default :
  308. CLD.SY.selectedIndex=tY-1900;
  309. CLD.SM.selectedIndex=tM;
  310. }
  311. changeCld();
  312. }
  313. var Today = new Date();
  314. var tY = Today.getFullYear();
  315. var tM = Today.getMonth();
  316. var tD = Today.getDate();
  317. var width = "130";
  318. var offsetx = 2;
  319. var offsety = 16;
  320. var x = 0;
  321. var y = 0;
  322. var snow = 0;
  323. var sw = 0;
  324. var cnt = 0;
  325. var dStyle;
  326. document.onmousemove = mEvn;
  327. function mOvr(v) {
  328. var s,festival;
  329. var sObj=eval('SD'+ v);
  330. var d=sObj.innerHTML-1;
  331. if(sObj.innerHTML!='') {
  332. sObj.style.cursor = 's-resize';
  333. if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '')
  334. festival = '';
  335. else
  336. festival = '<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#CCFFCC"><TR><TD>'+
  337. '<FONT COLOR="#000000" >'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld[d].lunarFestival+'</FONT></TD>'+
  338. '</TR></TABLE>';
  339. s= '<TABLE WIDTH="130" BORDER=0 CELLPADDING="2" CELLSPACING=0 BGCOLOR="#000066"><TR><TD>' +
  340. '<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN="right"><FONT COLOR="#ffffff">'+
  341. cld[d].sYear+' &#x5E74; '+cld[d].sMonth+' &#x6708; '+cld[d].sDay+' &#x65E5;<br>&#x661F;&#x671F;'+cld[d].week+'<br>'+
  342. '<font color="violet">&#x519C;&#x5386;'+(cld[d].isLeap?'&#x95F0; ':' ')+cld[d].lMonth+' &#x6708; '+cld[d].lDay+' &#x65E5;</font><br>'+
  343. '<font color="yellow">'+cld[d].cYear+'&#x5E74; '+cld[d].cMonth+'&#x6708; '+cld[d].cDay + '&#x65E5;</font>'+
  344. '</FONT></TD></TR></TABLE>'+ festival +'</TD></TR></TABLE>';
  345. document.all["detail"].innerHTML = s;
  346. if (snow == 0) {
  347. dStyle.left = x+offsetx-(width/2);
  348. dStyle.top = y+offsety;
  349. dStyle.visibility = "visible";
  350. snow = 1;
  351. }
  352. }
  353. }
  354. function mOut() {
  355. if ( cnt >= 1 ) { sw = 0 }
  356. if ( sw == 0 ) { snow = 0; dStyle.visibility = "hidden";}
  357. else cnt++;
  358. }
  359. function mEvn() {
  360. x=event.x;
  361. y=event.y;
  362. if (document.body.scrollLeft)
  363. {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
  364. if (snow){
  365. dStyle.left = x+offsetx-(width/2)
  366. dStyle.top = y+offsety
  367. }
  368. }
  369. function tick() {
  370. var today
  371. today = new Date()
  372. Clock.innerHTML = today.toLocaleString().replace(/(&#x5E74;|&#x6708;)/g, "/").replace(/&#x65E5;/, "");
  373. window.setTimeout("tick()", 1000);
  374. }
  375. function setCookie(name, value) {
  376. var today = new Date()
  377. var expires = new Date()
  378. expires.setTime(today.getTime() + 1000*60*60*24*365)
  379. document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString()
  380. }
  381. function getCookie(Name) {
  382. var search = Name + "="
  383. if(document.cookie.length > 0) {
  384. offset = document.cookie.indexOf(search)
  385. if(offset != -1) {
  386. offset += search.length
  387. end = document.cookie.indexOf(";", offset)
  388. if(end == -1) end = document.cookie.length
  389. return unescape(document.cookie.substring(offset, end))
  390. }
  391. else return ""
  392. }
  393. }
  394. function initial() {
  395. dStyle = detail.style;
  396. CLD.SY.selectedIndex=tY-1900;
  397. CLD.SM.selectedIndex=tM;
  398. drawCld(tY,tM);
  399. tick();
  400. }
  401. </SCRIPT>
  402. <STYLE>.todyaColor {
  403. BACKGROUND-COLOR: aqua
  404. }
  405. </STYLE>
  406. <BODY onload=initial()>
  407. <DIV id=detail style="POSITION: absolute"></DIV>
  408. <FORM name=CLD>
  409. <div align="center">
  410. <TABLE width=100% align="center" height="40" bordercolordark="#CC9900" border=1>
  411. <center>
  412. <TBODY>
  413. <TD align=middle vAlign=top width=100% height=50%>
  414. <!-- 本机计算机时间UTF8转码后为下一行的:&#x672C;&#x5730;&#x8BA1;&#x7B97;&#x673A;&#x65F6;&#x95F4;-->
  415. <center><font color=RED><span>&#x672C;&#x5730;&#x8BA1;&#x7B97;&#x673A;&#x65F6;&#x95F4;:</span> </FONT></FONT><BR><FONT color=#000080 id=Clock size=3 align="center"></FONT>
  416. <!--时区 *表示自动调整为日光节约时间-->
  417. </TABLE>
  418. </div>
  419. <center><tr>---------------------------------------------------------</tr></center>
  420. <div align="center">
  421. <table width=100% align="center" height="40" border=1>
  422. <CENTER>
  423. <center>
  424. <TBODY>
  425. </center></center>
  426. <td height="40" width=80% align="center"><font size="2">
  427. <!-- 公历,年,月UTF8转码后为 &#x516C;&#x5386; &#x5E74; &#x6708;-->
  428. <font color="#0000FF">&#x516C;&#x5386;&nbsp;</font>&#x5E74;</font><FONT color=#ffffff ><SELECT name=SY onchange=changeCld()>
  429. <SCRIPT type="text/javascript" >
  430. for(I=1900;I<2050;I++) document.write('<option>'+I)
  431. </SCRIPT>
  432. </SELECT> </FONT>&#x6708;<FONT color=#ffffff ><SELECT name=SM onchange=changeCld() >
  433. <SCRIPT type="text/javascript" >
  434. for(I=1;I<13;I++) document.write('<option>'+I)
  435. </SCRIPT>
  436. </SELECT></FONT></font>
  437. <!-- 阴历,年,月UTF8转码后为 &#x9634;&#x5386; &#x5E74; &#x6708;-->
  438. <br><font size="2"><FONT ><font color="#0000FF">&#x9634;&#x5386;&nbsp;</font>&#x5E74;</font><FONT color=#ffffff ><SELECT name=D1 onchange=changeLong() >
  439. <SCRIPT type="text/javascript" >
  440. for(I=1900;I<2050;I++) document.write('<option>'+I)
  441. </SCRIPT>
  442. </SELECT> </FONT>&#x6708;<FONT color=#ffffff ><SELECT name=D2 onchange=changeLong() >
  443. <SCRIPT type="text/javascript" >
  444. for(I=1;I<13;I++) document.write('<option>'+I)
  445. </SCRIPT>
  446. </SELECT></FONT></font></br></div>
  447. <!-- 月,当月 UTF8转码后为 &#x6708; &#x5F53;&#x6708;-->
  448. <!-- ↑ ↓ UTF8转码后为 &#x2191; &#x2193;-->
  449. <td height="40" width=20% align="center">
  450. <BUTTON onclick="pushBtm('MU')" >&#x6708;&#x2191; &nbsp;</BUTTON><br>
  451. <BUTTON onclick="pushBtm('')" >&#x5F53;&#x6708;</BUTTON><br>
  452. <BUTTON onclick="pushBtm('MD')" >&#x6708;&#x2193; &nbsp;</BUTTON>
  453. </td>
  454. <CENTER>
  455. <!--'阴历存在跨月情况,如果查找到的阴历月跨两个公历月,用' UTF8转码后为 &#x9634;&#x5386;&#x5B58;&#x5728;&#x8DE8;&#x6708;&#x60C5;&#x51B5;&#xFF0C;&#x5982;&#x679C;&#x67E5;&#x627E;&#x5230;&#x7684;&#x9634;&#x5386;&#x6708;&#x8DE8;&#x4E24;&#x4E2A;&#x516C;&#x5386;&#x6708;&#xFF0C;&#x7528;-->
  456. <!-- '翻动可以找到你想要的确切日期。'UTF8转码后为 &#x7FFB;&#x52A8;&#x53EF;&#x4EE5;&#x627E;&#x5230;&#x4F60;&#x60F3;&#x8981;&#x7684;&#x786E;&#x5207;&#x65E5;&#x671F;&#x3002;-->
  457. <table align=middle border=1 width=100% bordercolordark="#FFFFCC">
  458. <td width="100%" align=middle ><font color=#0> &#x9634;&#x5386;&#x5B58;&#x5728;&#x8DE8;&#x6708;&#x60C5;&#x51B5;&#xFF0C;&#x5982;&#x679C;&#x67E5;&#x627E;&#x5230;&#x7684;&#x9634;&#x5386;&#x6708;&#x8DE8;&#x4E24;&#x4E2A;&#x516C;&#x5386;&#x6708;&#xFF0C;&#x7528;<font color=blue>[&#x6708;&#x2191;][&#x6708;&#x2193;]</font>&#x7FFB;&#x52A8;&#x53EF;&#x4EE5;&#x627E;&#x5230;&#x4F60;&#x60F3;&#x8981;&#x7684;&#x786E;&#x5207;&#x65E5;&#x671F;&#x3002;</font></td>
  459. <center><tr>---------------------------------------------------------</tr></center>
  460. </table>
  461. </CENTER>
  462. </table>
  463. <center><tr>---------------------------------------------------------</tr></center>
  464. <FONT id=YMBG COLOR=#f0f0f0> </FONT>
  465. <div align="center">
  466. <center>
  467. <TABLE align="center" border=1 width=100% cellspacing="1">
  468. <center>
  469. <TBODY>
  470. <center>
  471. <TR>
  472. <center><TD bgColor=#000080 colSpan=7 align="center" width=100% height="25"><FONT color=#000080 size=2> </FONT>
  473. <center> <FONT color=#ffffff id=GZ size=4></FONT><BR></TD></TR>
  474. <center> <TR align=middle bgColor=#e0e0e0>
  475. <center>
  476. <!-- 日一二三四五六 UTF8转码后为 &#x65E5; &#x4E00; &#x4E8C; &#x4E09; &#x56DB; &#x4E94; &#x516D; -->
  477. <center> <TD width=15% align="center" bgcolor="#99CCFF"><font size="2">&#x65E5;</font></TD>
  478. <center> <TD width=14% align="center" bgcolor="#99CCFF"><font size="2">&#x4E00;</font></TD>
  479. <center> <TD width=14% align="center" bgcolor="#99CCFF"><font size="2">&#x4E8C;</font></TD>
  480. <center> <TD width=14% align="center" bgcolor="#99CCFF"><font size="2">&#x4E09;</font></TD>
  481. <center> <TD width=14% align="center" bgcolor="#99CCFF"><font size="2">&#x56DB;</font></TD>
  482. <center> <TD width=14% align="center" bgcolor="#99CCFF"><font size="2">&#x4E94;</font></TD>
  483. <center> <TD width=15% align="center" bgcolor="#99CCFF"><font size="2">&#x516D; </font></TD></TR>
  484. <center> <SCRIPT type="text/javascript" >
  485. var gNum
  486. for(I=0;I<6;I++) {
  487. document.write('<tr align=center>')
  488. for(j=0;j<7;j++) {
  489. gNum = I*7+j
  490. document.write('<td id="GD' + gNum +'" onMouseOver="mOvr(' + gNum +')" onMouseOut="mOut()"><font id="SD' + gNum +'" size=2 ')
  491. if(j == 0) document.write(' color=red')
  492. if(j == 6)
  493. if(I%2==1) document.write(' color=red')
  494. else document.write(' color=green')
  495. document.write(' TITLE=""> </font><br><font id="LD' + gNum + '" size=2 > </font></td>')
  496. }
  497. document.write('</tr>')
  498. }
  499. </SCRIPT>
  500. </TBODY></TABLE>
  501. </center>
  502. </div>
  503. </TD>
  504. </TR></TBODY></TABLE>
  505. </div>
  506. </FORM>
  507. </body>
  508. </td>
  509. <!-- 日历代码结束-->
  510. </ul>
  511. </div>

 

转载于:https://my.oschina.net/u/3372900/blog/878655

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/636157
推荐阅读
相关标签
  

闽ICP备14008679号