主题:  贴一个很好的日历程序,放在自己的个人主页里非常好

ryonick

职务:普通成员
等级:2
金币:1.0
发贴:317
注册:2002/11/4 15:57:45
#12003/6/30 10:42:57
<%

'月份名称定义
Dim Month_Name(12)
Month_Name(1) = "一月"
Month_Name(2) = "二月"
Month_Name(3) = "三月"
Month_Name(4) = "四月"
Month_Name(5) = "五月"
Month_Name(6) = "六月"
Month_Name(7) = "七月"
Month_Name(8) = "八月"
Month_Name(9) = "九月"
Month_Name(10) = "十月"
Month_Name(11) = "十一月"
Month_Name(12) = "十二月"

'年份处理,默认值为服务器当前年份
if request.querystring("year")<>"" then
Year_var=cint(request.querystring("year"))
else
Year_var=year(date())
end if

'上一年、下一年赋值
Previous_year=Year_var-1
Next_year=Year_var+1


'月份处理,默认值为服务器当前月份
if request.querystring("Month")<>"" then
Month_var=cint(request.querystring("Month"))
else
Month_var=month(date())
end if

'上一月、下一月赋值
if Month_var<=1 then
Next_month=Month_var+1
Previous_month=1
else
if Month_var>=12 then
Next_month=12
Previous_month=Month_var-1
else
Next_month=Month_var+1
Previous_month=Month_var-1
end if
end if

'当前天数定位计算
First_day=DateSerial(Year_var,Month_var,1)
Current_day=First_day-weekday(First_day)+2

%>


日历


















<%response.write Month_Name(Month_var) & " " & Year_var & "年"%>
4
8










            <%
'日历内容 5行*7例 显示
'外层循环显示控制行
for i=0 to 4
%>

<%
'内层循环显示控制列

for j=0 to 6
response.write ""
next
%>


<%next%>
星期一
星期二
星期三
星期四
星期五
星期六
星期日

'天数显示,“今天”显示

if Current_day = date then
response.write " bgcolor='#FFFFE0'>"
%><%=day(Current_day)%><%
else

'天数显示,非本月天数显示
if Month(Current_day) <> Month_var then
response.write " bgcolor='#F0F0F0'>"
%>
<%=day(Current_day)%><%
else

'天数显示,本月天数显示
response.write ">"
%>
<%=day(Current_day)%><%
end if

end if

'天数累加推算

Current_day = Current_day + 1
response.write "






----------------------------------------
演示地址 www.02188.com/try/date.asp

编辑历史:[这消息被ryonick编辑过(编辑时间2003-06-30 13:27:31)]


爱多媒体爱生活

职务:普通成员
等级:2
金币:1.0
发贴:303
注册:2003/2/20 14:25:56
#22003/6/30 12:31:57
很酷??



我有BLOG了

职务:普通成员
等级:4
金币:16.8
发贴:2209
注册:2003/1/22 2:08:39
#32003/6/30 13:34:27
写的很好,我很喜欢,研究ing~



510top

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2003/4/10 10:48:08
#42003/6/30 14:21:49
这个不错~~
以前我怎么没想到在自己的主页上加上日历呢:)



dqmh

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2003/6/16 17:55:50
#52003/6/30 15:32:27
不错呀!要是星期日的颜色变以点就好了。自己改把! ;)