日期选择器

作者:网络 来源:佚名 更新时间:2008-02-05 12:16:01 点击:
国内最大的酷站演示中心!
'file name /getdate.asp/

<%rec=request("rec")%>
<html>
<head>

<meta name="generator" content="microsoft visual studio 6.0">
<style type="text/css">
<!--
.head_tab {  font-family: "times new roman", "times", "serif"; font-size: 10pt; color: #9999ff; font-weight: bold}
.no {  font-size: 12pt; color: #ccccff; text-decoration: none}
a:hover {  font-size: 9pt; color: #6666ff; text-decoration: none; font-weight: bold}
a:link {  text-decoration: none; font-size: 12pt; color: #ccccff}
-->
</style>
<script language="javascript">

var yearno, monthno, dayno

function isruny(yearno)
{
    if (yearno%4==0) {
        if (yearno%100!=0 || (yearno%100==0 && yearno%400==0)){
            return true;
        }
        else {return false;}
    }
    else {return false;}    
}

function daysum(yearno, monthno){
    if(monthno==1 || monthno==3 || monthno==5 || monthno==7 || monthno==8 || monthno==10 || monthno==12){return 31;}
    if (monthno==4 || monthno==6 || monthno==9 || monthno==11 ) {return 30;}
    if (monthno==2){
        if (isruny(yearno)){return 29;}
        else {return 28;}
    }
}        

function firstday(yearno, monthno){
    var dayval=new date(yearno+"/"+monthno+"/01");
    firstday=dayval.getday();
    return (firstday);
}
function gettoday(){
    var dayval=new date();
    return dayval.getdate();
}
function getnowmonth(){
    var dayval=new date();
    return (dayval.getmonth()+1);
}    
function getnowyear(){
    var dayval=new date();
    return dayval.getyear();
}
/*
for (i=0; i<=41; i++){
    test=test+dayout[i]+"-";
}
*/
function output(yearno, monthno){
    var test="-"
    var dayout = new array();
    for (i=0; i<=41; i++){
        dayout[i]=0;
    }

    var n=0;
    var row=0;
    b=firstday(yearno, monthno);
    e=b+daysum(yearno, monthno)-1;
    for (j=b; j<=e ; j++){
        n=n+1;
        dayout[j]=n;
    }
    
    is_ep_15="<td width=\"15%\" height=\"25\"><div align=\"center\"> </div></td>"
    is_ep_14="<td width=\"14%\" height=\"25\"><div align=\"center\"> </div></td>"
    ep_15_y="<td width=\"15%\" height=\"25\"><div align=\"center\"><a class=no style=\"color: #33ff33\" href=\"javascript:returndate("+gettoday()+")\">"+gettoday()+"</a></div></td>"
    ep_14_y="<td width=\"14%\" height=\"25\"><div align=\"center\"><a class=no style=\"color: #33ff33\" href=\"javascript:returndate("+gettoday()+")\">"+gettoday()+"</a></div></td>"
    for (i=0; i<=41; i++){
    ep_15_n="<td width=\"15%\" height=\"25\"><div align=\"center\"><a class=no href=\"javascript:returndate("+dayout[i]+")\">"+dayout[i]+"</a></div></td>&qu