网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
ASP
> 正文
asp日历代码
深山行者个人网站 2009/12/22 14:07:45 深山行者 字体:
大
中
小
浏览 12965
演示效果
以下为详细代码
<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 当日访问量,全部访问量,当前在线人数统计
相关阅读
网页制作中关于浏览器宽度和高度的设定研究(转载)
深山留言板 v7.0.1 bulid2014.11.15更新
JS操作Cookie记录
长春天马国际旅行社
根据页面模板动态生成html页面
鼠标放在表格区域内,当前格的一整行和一整列变色
兼容IE和FF的收藏本站、设为首页代码
山西省青年旅行社
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
DIV+CSS
HTML
python
更多>>
同类信息
ASP中Utf-8与Gb2312编码转换乱码问题的解决方法页面编码声明
asp显示随机密码
通过阿里云服务接口获得ip地址详细信息
iis点开后任务栏上有显示,但是窗口看不到的解决办法
RSA加密解密插件
微软Encoder加密解密函数
更多>>
最新添加文章
2026 aliyun阿里域名云注册续费优惠口令
dw里面查找替换使用正则删除sqlserver里面的CONSTRAINT
Android移动端自动化测试:使用UIAutomatorViewer与Selenium定位元素
抖音直播音挂载小雪花 懂车帝小程序
javascript获取浏览器指纹可以用来做投票
火狐Mozilla Firefox出现:无法载入您的Firefox配置文件 它可能已经丢失 或是无法访问 问题解决集合处理办法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
python通过代码修改pip下载源让下载库飞起
更多>>
随机抽取信息
设置个性的文字链接样式,集齐网页上常见的链接样式
asp正则替换内容里的CSS样式
静态网站利用微信URL Scheme生成的ticket从浏览器h5跳到微信小程序完整代码
另外一种符合web2.0的链接打开方式--利用base打开链接
开始百度小程序开发需要准备工作
网页小键盘/软键盘
更多标签
热门标签
CSS规范
屏幕
radio
163
select
菜单
固定
蜘蛛
半透明
刷新
十字
调用
层
浮动
墙
翻页
时钟
计划
关键词
查询
字节数
DropShadow
png
添加
缓存
深山行者V1.2旅行社网站管理系统
素材
上 下 左 右
日期
旅行社
点击
alert
忧化
列表
断线
深山行者
案例
绿色
VBScript
后台
营销
对象
显示
media
阴影效果
getElementById
渐变
旅游
汉字
list
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号