一个日历程序

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="180" cellpadding="0" cellspacing="1" align=center>
<%
If Trim(Request("ReqDate"))="" or ( not IsDate(Trim(Request("ReqDate"))) ) then
 CurrentDate=Date
else
 CurrentDate=Trim(Request("ReqDate"))
end if
PreviousMonthDate=DateAdd("m",-1,CurrentDate)
NextMonthDate=DateAdd("m",1,CurrentDate)
%>
  <tr align="LEFT" bgcolor="#dddddd">
    <td width="14%" height="19" align="center">
 <a href="blogList.asp?ReqDate=<%=PreviousMonthDate%>&hiddenID=<%getUserName(3)%>"><<</a> </td>
    <td colspan="5" align="center" bgcolor="#dddddd"><%=year(CurrentDate)&"年"&month(CurrentDate)&"月"%></td>
    <td width="14%" align="center" bgcolor="#dddddd">
 <a href="blogList.asp?ReqDate=<%=NextMonthDate%>&hiddenID=<%getUserName(3)%>">>></a> </td>
  </tr>
  <tr align="LEFT" bgcolor="#CCCCCC">
    <td width="14%" height="19"> 日</td>
    <td width="14%"> 一</td>
    <td width="14%"> 二</td>
    <td width="14%"> 三</td>
    <td width="14%"> 四</td>
    <td width="14%"> 五</td>
    <td width="14%"> 六</td>
  </tr>
  <%
ym=year(CurrentDate)&"-"&month(CurrentDate)&"-"
i=1
do while i<33
 j=1
 response.write("<tr bgcolor=ffffff height=19>")
 do while j<8
  If IsDate(ym&i) then
   CurrentWeekDay=weekday(ym&i)
   if j=CurrentWeekDay then
      LinkText=i
     if i<>Day(now) then
     response.write("<td>&nbsp;"&LinkText&"</td>")
    else
     response.write("<td bgcolor=ffaaaa>&nbsp;"&LinkText&"</td>")   
    end if
    i=i+1
   else
    response.write("<td></td>")
   end if
  else
   response.write("<td></td>")
   i=i+1
   'exit do
  end if
  j=j+1
 loop
 response.write("</tr>")
loop
%>
</table>

</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值