sub Calendar(CurrentDate,IsForward,IsBack)
If Trim(CurrentDate)="" or ( not IsDate(Trim(CurrentDate)) ) then
CurrentDate=Date
end if
PreviousMonthDate=DateAdd("m",-1,CurrentDate)
NextMonthDate=DateAdd("m",1,CurrentDate)
if IsForward then
CurrentDate=dateadd("m",1,CurrentDate)
elseif IsBack then
CurrentDate=dateadd("m",-1,CurrentDate)
end if
%>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="table_line">
<tr>
<td align="center" bgcolor="#eeeeee" class="td_padding" colspan="5"><strong>招商项目留言管理</strong></td>
</tr>
<tr>
<td class="left_padding"><table width="180" cellpadding="0" cellspacing="1" bgcolor="dddddd" align="center" style="float:left">
<tr align="left" bgcolor="#dddddd">
<td width="14%" height="20"><input type="button" value="<<" onclick="JavaScript:window.location.href='?ReqDate=<%=PreviousMonthDate%>'"></td>
<td colspan="5" align="center"><%=year(CurrentDate)&"年"&month(CurrentDate)&"月"%></td>
<td width="14%"><input type="button" value=">>" onclick="JavaScript:window.location.href='?ReqDate=<%=NextMonthDate%>'"></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td width="14%" height="20"> 日</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)&"-"&right("0"&month(CurrentDate),2)&"-"
i=1
currentMonthDays=datediff("d",CurrentDate,dateadd("m",1,CurrentDate))
do while i<currentMonthDays+1
j=1
response.write("<tr bgcolor=""ffffff"" height=""20"">")
do while j<8
If IsDate(ym&i) then
CurrentWeekDay=weekday(ym&i)
if j=CurrentWeekDay then
If Datediff("d",ym&i,now)>-1 then
LinkText="<a href=""business_liuyan.asp?curDate="&ym&""&i&""" target=""main"">"&i&"</a>"
else
LinkText=i
end if
if i<>Day(now) then
response.write("<td> "&LinkText&"</td>")
else
response.write("<td bgcolor=""ffaaaa""> "&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>"&vbcrlf)
loop
%>
</table>
<%
end sub
'调用示例
CurrentDate=Trim(Request("ReqDate")):Calendar CurrentDate,false,false
%>
</td>
</tr>
</table>
我想实现:当点击日历上的日期就查询出当天的数据,但是遇到一个问题,当前月可以实现,但是点击其他月的日期时,又会跳转到当前月,怎么改动这个日历让他不跳转到当前月?请大家帮帮忙,谢谢大家!!
2 个解决方案
#1
有点小问题
#2
怎么没人..
#1
有点小问题
#2
怎么没人..