标题:跪求万年历代码
只看楼主
ggphaoshuai
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-5-18
 问题点数:0 回复次数:2 
跪求万年历代码
菜鸟学弟刚接触ASP  向各位师哥师姐跪求万年历代码,只有日期就可以~~~~
搜索更多相关主题的帖子: 万年历 代码 ASP 师哥 师姐 
2008-05-18 09:47
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
<script type="text/javascript">
function buildCal(m, y, cM, cH, cDW, cD, brdr){
var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr>';
t+='<td colspan="7" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr>';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
t+='</tr><tr>';
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : ' ';
if (x==scanfortoday) //DD added
x='<span id="today">'+x+'</span>' //DD added
t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr>';
}
return t+='</tr></table></div>';
}
</script>


 <script type="text/javascript">

var todaydate=new Date()
var curmonth=todaydate.getMonth()+1; //get current month (1-12)
var curyear=todaydate.getFullYear(); //get current year

document.write(buildCal(curmonth, curyear, "main", "month", "daysofweek", "days", 0));
</script>

2008-05-18 09:54
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
得分:0 
给你一个完整的:

[[it] 本帖最后由 towering 于 2008-5-19 15:12 编辑 [/it]]

wnl.rar (16.8 KB)
2008-05-19 15:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-214869-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.347810 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved