网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
ASP
> 正文
asp日历代码
深山行者个人网站 2009/12/22 14:07:45 深山行者 字体:
大
中
小
浏览 12925
演示效果
以下为详细代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="http://purl.org/dc" rel="schema.DC" /> <title>asp日历代码</title ></head> <body bgcolor="#FFFFFF"> <% ' 要调用的函数声明 '根据年份及月份得到每月的总天数 Function GetDaysInMonth(iMonth, iYear) Select Case iMonth Case 1, 3, 5, 7, 8, 10, 12 GetDaysInMonth = 31 Case 4, 6, 9, 11 GetDaysInMonth = 30 Case 2 If IsDate("February 29, " & iYear) Then GetDaysInMonth = 29 Else GetDaysInMonth = 28 End If End Select End Function '得到一个月开始的日期. Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth) Dim dTemp dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth) GetWeekdayMonthStartsOn = WeekDay(dTemp) End Function '得到当前一个月的上一个月. Function SubtractOneMonth(dDate) SubtractOneMonth = DateAdd("m", -1, dDate) End Function '得到当前一个月的下一个月. Function AddOneMonth(dDate) AddOneMonth = DateAdd("m", 1, dDate) End Function ' 函数声明结束 Dim dDate ' 日历显示的日期 Dim iDOW ' 每一月开始的日期 Dim iCurrent ' 当前日期 Dim iPosition ' 表格中的当前位置 ' 得到选择的日期并检查日期的合法性 If IsDate(Request.QueryString("date")) Then dDate = CDate(Request.QueryString("date")) Else If IsDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Then dDate = CDate(Request.QueryString("month") & "-" & Request.QueryString("day") & "-" & Request.QueryString("year")) Else dDate = Date() If Len(Request.QueryString("month")) <> 0 Or Len(Request.QueryString("day")) <> 0 Or Len(Request.QueryString("year")) <> 0 Or Len(Request.QueryString("date")) <> 0 Then Response.Write "您所选择的日期格式不正确,系统会使用当前日期.<BR><BR>" End If End If End If '得到日期后我们先得到这个月的天数及这个月的起始日期. iDIM = GetDaysInMonth(Month(dDate), Year(dDate)) iDOW = GetWeekdayMonthStartsOn(dDate) %> <table width="180" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5"> </td> </tr> </table> <table width="180" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" colspan="7"><table border="0" cellpadding="0" cellspacing="0"width="100%"> <tr> <td height="22" align="right"><a href="rl.asp?date=<%= SubtractOneMonth(dDate) %>"><img src="../images/dot_left.gif" width="15" height="14" border="0" /></a></td> <td align="center"><font color="999999"><b><%= MonthName(Month(dDate)) & " " & Year(dDate) %></b></font></td> <td><a href="rl.asp?date=<%= AddOneMonth(dDate) %>"><img src="../images/dot_right.gif" width="15" height="14" border="0" /></a></td> </tr> </table></td> </tr> <tr> <td width="25" height="22" align="center"><font color="d08c00"><b>日</b></font> </td> <td width="25" align="center"><b><font color="999999">一</font></b> </td> <td width="25" align="center"><b><font color="999999">二</font></b> </td> <td width="25" align="center"><b><font color="999999">三</font></b> </td> <td width="25" align="center"><b><font color="999999">四</font></b> </td> <td width="25" align="center"><b><font color="999999">五</font></b> </td> <td width="25" align="center"><b><font color="d08c00">六</font></b> </td> </tr> <% ' 如果这个月的起始日期不是周日的话就加空的单元. If iDOW <> 1 Then Response.Write vbTab & "<TR>" & vbCrLf iPosition = 1 Do While iPosition < iDOW Response.Write vbTab & vbTab & "<TD> </TD>" & vbCrLf iPosition = iPosition + 1 Loop End If ' 绘制这个月的日历 iCurrent = 1 iPosition = iDOW Do While iCurrent <= iDIM ' 如果是一行的开头就使用 TR 标记 If iPosition = 1 Then Response.Write vbTab & "<TR>" & vbCrLf End If ' 如果这一天是我们选择的日期就高亮度显示该日期. If iCurrent = Day(dDate) Then Response.Write vbTab & vbTab & "<TD BGCOLOR=#eeeeee height=18 align=center><B>" & iCurrent & "</B></TD>" & vbCrLf Else Response.Write vbTab & vbTab & "<TD height=18 align=center><A HREF=""./rl.asp?date=" & Month(dDate) & "-" & iCurrent & "-" & Year(dDate) & """>" & iCurrent & "</A></TD>" & vbCrLf End If ' 如果满一周的话表格就另起一行 If iPosition = 7 Then Response.Write vbTab & "</TR>" & vbCrLf iPosition = 0 End If iCurrent = iCurrent + 1 iPosition = iPosition + 1 Loop ' 如果一个月不是以周六结束则加上相应的空单元. If iPosition <> 1 Then Do While iPosition <= 7 Response.Write vbTab & vbTab & "<TD> </TD>" & vbCrLf iPosition = iPosition + 1 Loop Response.Write vbTab & "</TR>" & vbCrLf End If %> </table> <table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5"> </td> </tr> </table></td> </tr> </table>
前一页:
ASP汉字转拼音,支持自定义特殊词语
后一页:
asp 当日访问量,全部访问量,当前在线人数统计
相关阅读
北京阳光无限贸易有限公司
css解决中英混合链接下划线不对齐问题
模板自由切换
利用java使图片左右上下循环连续滚动不出现空白
增大、缩小、还原字体
Dreamweaver错误:在onload运行_beforeSave.htm时,发生了一个JavaScript错误
圣诞节12.5号,白雪天地留言板模板
抖音直播音挂载小雪花 懂车帝小程序
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
DIV+CSS
HTML
python
更多>>
同类信息
ASP中Utf-8与Gb2312编码转换乱码问题的解决方法页面编码声明
asp显示随机密码
通过阿里云服务接口获得ip地址详细信息
iis点开后任务栏上有显示,但是窗口看不到的解决办法
RSA加密解密插件
微软Encoder加密解密函数
更多>>
最新添加文章
dw里面查找替换使用正则删除sqlserver里面的CONSTRAINT
Android移动端自动化测试:使用UIAutomatorViewer与Selenium定位元素
抖音直播音挂载小雪花 懂车帝小程序
javascript获取浏览器指纹可以用来做投票
火狐Mozilla Firefox出现:无法载入您的Firefox配置文件 它可能已经丢失 或是无法访问 问题解决集合处理办法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
python通过代码修改pip下载源让下载库飞起
python里面requests.post返回的res.text还有其它的吗
更多>>
随机抽取信息
呼伦贝尔市四季风旅行社
div中设置文字垂直居中
深山行者留言系统V2.3
Object.assign的一些用法
石家庄燕赵旅行社有限公司
推荐:ASP初学者常用源代码总结篇
更多标签
热门标签
xhtml
Excel
页面
渐隐
absolute
圆角
relative
个人
滤镜
DOCTYPE
源文件
标签
学习
li
特效
position
Java
强聊
代码
右击失效
html
第几楼
文件类型
标语
源码
色彩
详解
面板
important
2.0
单选
首字母
收藏夹
photoshop
调色板
style
长
px
选择符
配色
千位
性能
多选框
查找
word-spacing
载入
光标
锚点
Margin加倍
在线
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号