复制代码代码如下所示:

TD { font-family:歌体;字体大小:9pt }



<
以下是通过此日历算法在ASP中实现的特定代码

第一个判断是否指定年份和月份,而没有根据当前年份和月份显示。
如果请求(reqdate )=
currentdate =日期
其他的
currentdate =装饰(请求(reqdate ))
最后如果
职业年=年(currentdate)
P =月(currentdate)

下面的代码生成日历显示的表头内容
%>


>


年


> >onclick=Javascript:位置。href = 'reqdate =>



白天
一
二
三
四
五
六


<
因为ASP没有在指定月份得到总天数的函数,所以我们需要通过其他算法得到它。这个算法实际上非常简单,就是从下个月到下个月的1天计算1天。
fromdate = formatdatetime(月(currentdate) / / 1年(currentdate))
迄今为止,formatdatetime(DateAdd(M
把这个月的第一天展示出来
nunmonthstart =平日(fromdate)- 1
1天和1天之间的差额是几天的差额(一个月有多少天)。
nunmonthend = DateDiff(D
判断显示日历需要以几行显示(每行7天)。
如果nunmonthstart + nunmonthend<36
马克西= 36
其他的
马克西= 43
最后如果
循环生成表单和显示
我= 1
当我<马克西
四= i-nunmonthstart
如果我和我的nunmonthstart <= nunmonthend + nunmonthstart然后
如果今天显示的话,它是以红色背景显示的。
如果四=天(现在)和月(现在)= P和年(现在)=职业年然后
response.write(IV)
其他的
response.write(IV)
最后如果
其他的
response.write()
最后如果

如果可以除以7(每行7),则更改行的输出。
如果我7 = 0然后
response.write()
最后如果
i = i + 1
环
%>