登录模块加载中...
会员投稿 投稿指南 今天是:
打印本页 | 关闭窗口 | 双击滚屏 您的位置首页>>网页制作学习园地>>ASP教程>>ASP基础>>asp制作的日历程序
asp制作的日历程序
来源: ‖ 作者: ‖ 点击: ‖ 时间:14-03-13 14:29:44 ‖ 【 】‖ 我要投稿

纯ASP打造的日历程序,可自行美化,这里仅提供最简单的CSS样式。。。


<%
'=================================
'说明:日历文件
'=================================
'取出对应的年月博客日志数据
'=======================
Ryear = CInt(request.querystring("year"))
Rmonth = CInt(request.querystring("month"))
If Ryear = 0  Or Ryear = NULL Then Ryear = year(now)
If Rmonth = 0 Or Rmonth = NULL Then Rmonth = month(now)
nowtime = Ryear&"-"&Rmonth&"-1"   '得到本月第一天
nowyear = year(nowtime)           '年份
nowmonth = month(nowtime)         '月份
nowweekday = weekday(nowtime) - 1 '当前礼拜
'获取2月天数
febdays = 28
If nowyear / 4 = 0 Then febdays = 29
'获取本月天数
If nowmonth = 1 then
    monthdays = 31
ElseIf nowmonth = 2 Then    
    monthdays = febdays
ElseIf nowmonth = 3 Then    
    monthdays = 31
ElseIf nowmonth = 4 Then    
    monthdays = 30
ElseIf nowmonth = 5 Then    
    monthdays = 31
ElseIf nowmonth = 6 Then    
    monthdays = 30
ElseIf nowmonth = 7 Then    
    monthdays = 31
ElseIf nowmonth = 8 Then    
    monthdays = 31
ElseIf nowmonth = 9 Then    
    monthdays = 30
ElseIf nowmonth = 10 Then    
    monthdays = 31
ElseIf nowmonth = 11 Then    
    monthdays = 30
Else
    monthdays = 31
End If
calendar =  " &lt;&lt;&nbsp;"
willshowmonthmonth = nowmonth
If willshowmonthmonth - 1 <= 0 Then willshowmonthmonth = 2
calendar =  calendar & " &lt;&nbsp;"
If willshowmonthmonth + 1 > 12 Then willshowmonthmonth = 11
calendar =  calendar & " &gt;&nbsp;"
calendar =  calendar & " &gt;&gt;&nbsp;"
calendar =  calendar & "

"&VBCRLF
calendar =  calendar & " 
"&VBCRLF
calendar =  calendar & "
"&nowyear&"-"&nowmonth&"-"&day(now)&"
日&
|<< << < 1 2 > >> >>|
加入收藏:  加入收藏夹  | 发送给好友:  发送给好友
责任编辑:admin
相关文章列表
请文明参与讨论,禁止漫骂攻击。  
网友评论