<style> body{font-size:12px; margin:20px 0 0 20px; padding:0} tr,td{text-align:center;} </style> <% '================================= '说明:日历文件 '================================= '取出对应的年月博客日志数据 '======================= ryear = cint(request.querystring("year")) rmonth = cint(request.querystring("month")) if ryear = 0 or ryear = null then ryear = year(now) if rmonth = 0 or rmonth = null then rmonth = month(now) nowtime = ryear&"-"&rmonth&"-1" '得到本月第一天 nowyear = year(nowtime) '年份 nowmonth = month(nowtime) '月份 nowweekday = weekday(nowtime) - 1 '当前礼拜 '获取2月天数 febdays = 28 if nowyear / 4 = 0 then febdays = 29 '获取本月天数 if nowmonth = 1 then monthdays = 31 elseif nowmonth = 2 then monthdays = febdays elseif nowmonth = 3 then monthdays = 31 elseif nowmonth = 4 then monthdays = 30 elseif nowmonth = 5 then monthdays = 31 elseif nowmonth = 6 then monthdays = 30 elseif nowmonth = 7 then monthdays = 31 elseif nowmonth = 8 then monthdays = 31 elseif nowmonth = 9 then monthdays = 30 elseif nowmonth = 10 then monthdays = 31 elseif nowmonth = 11 then monthdays = 30 else monthdays = 31 end if calendar = "<a href='?year="&nowyear - 1&"&month="&nowmonth&"'> <<</a> " willshowmonthmonth = nowmonth if willshowmonthmonth - 1 <= 0 then willshowmonthmonth = 2 calendar = calendar & "<a href='?year="&nowyear&"&month="&willshowmonthmonth - 1&"'> <</a> " if willshowmonthmonth + 1 > 12 then willshowmonthmonth = 11 calendar = calendar & "<a href='?year="&nowyear&"&month="&willshowmonthmonth + 1&"''> ></a> " calendar = calendar & "<a href='?year="&nowyear + 1&"&month="&nowmonth&"'> >></a> " calendar = calendar & "<table bgcolor=#000000 cellspacing=1 width=200><tr bgcolor=#ffffff><td colspan=7>"&nowyear&"-"&nowmonth&"-"&day(now)&"</td></tr>"&vbcrlf calendar = calendar & " <tr bgcolor=#ffffff>"&vbcrlf calendar = calendar & "<td>日</td>"&vbcrlf calendar = calendar & "<td>一</td>"&vbcrlf calendar = calendar & "<td>二</td>"&vbcrlf calendar = calendar & "<td>三</td>"&vbcrlf calendar = calendar & "<td>四</td>"&vbcrlf calendar = calendar & "<td>五</td>"&vbcrlf calendar = calendar & "<td>六</td>"&vbcrlf calendar = calendar & "</tr>"&vbcrlf calendar = calendar & vbcrlf&"<tr bgcolor=#ffffff>"&vbcrlf '把前面的空白补充出来 nowmonthfirstiweekday = weekday(nowyear&"-"&nowmonth&"-1") - 2 '本月第一天的星期 for i=0 to nowmonthfirstiweekday calendar = calendar & "<td bgcolor=#efefef> </td>"&vbcrlf next '开始循环写日期 t=1 for i=1 to monthdays if year(now) = year(nowyear&"-"&nowmonth&"-"&i) and day(now) = day(nowyear&"-"&nowmonth&"-"&i) then '高亮显示今日 calendar = calendar & "<td bgcolor=#cccccc><a href=''>"&i&"</a></td>"&vbcrlf else calendar = calendar & "<td>"&i&"</td>"&vbcrlf end if if weekday(nowyear&"-"&nowmonth&"-"&i) = 7 then t=t+1 calendar = calendar & "</tr><tr bgcolor=#ffffff>"&vbcrlf end if next for i=1 to (7*t-(nowmonthfirstiweekday+1+monthdays)) calendar = calendar & "<td bgcolor=#ffffff></td>"&vbcrlf next calendar = calendar & vbcrlf&"</tr>" calendar = calendar & "</table>"&vbcrlf response.write calendar %>