数码资讯
通过日历算法在ASP实现的特定代码
复制代码代码如下所示: TD { font-family:歌体;字体大小:9pt } > 年 > >onclick=Javascript:位置。href = 'reqdate => 白天 一 二 三 四 五 六
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
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
环
%>
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
环
%>
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。