网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
ASP
> 正文
asp日历代码
深山行者个人网站 2009/12/22 14:07:45 深山行者 字体:
大
中
小
浏览 12940
演示效果
以下为详细代码
<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 当日访问量,全部访问量,当前在线人数统计
相关阅读
js指定日期加n天加n月加n年
另外的一种单项的选择
asp正则替换内容里的特定内容
百度小程序开发第一坑tcomponent自定义组件命名坑Compile san component failed. . [SAN ERROR] ROOT>swan-custom-component>view>千万不要用下划线作为自定义组件名
shopify广告与Facebook广告操作
利用javascript静态改变表单指向与提交方式
按钮复制文章URL和复制保留文章的版权
微信小程序腾讯视频播放组件tencentvideo(wxa75efa648b60994b)
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
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还有其它的吗
更多>>
随机抽取信息
连云港五洲旅行社有限公司
网页中Flash弹出网页窗口的详细讲解
利用javascript仿的漂亮的flash效果的菜单
asp获取汉字拼音的第一个字母
深山旅行社网站管理系统 v1.8
用ASP对网页进行限制性的访问
更多标签
热门标签
shift
舒服
百度
拼音
换行
格式化
模板
expression
IE8
qq right
应用
电影
工作室
规则
日历
类别
Alpha
管理系统
XMLHTTP
RegExp
计算
思考
函数
错误
优化
下划线
垂直
CSS规范
FireFox
radio
工具
select
rad
固定
深山
半透明
下载
十字
height
时间
浮动
textarea
翻页
首页
计划
查询
input
DropShadow
图片
彩色
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号