争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

ASP+JavaScript的完整的日历使用

时间:2024/6/17作者:未知来源:争怎路由网人气:

 

第一步:保存下列文件为:CALENDAR.ASP

<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Function sFont(iSize,sFace,sColor,bScale)
 Dim sOutputStr
 sOutputStr = "<FONT"
 if sFace <> "" then
   sOutputStr = sOutputStr & " FACE='" & sFace & "'"
 else
   sOutputStr = sOutputStr & " FACE='Helv'"
 end if

 if iSize = "" then
  iSize = 1
 end if
 if bScale then
  iSize = cInt(iSize * 1)
 end if
 sOutputStr = sOutputStr & " SIZE=" & iSize
 if sColor <> "" then
   sOutputStr = sOutputStr & " COLOR=" & sColor
 end if
 
 sOutputStr = sOutputStr & ">"

 sFont = sOutputStr
End Function
On Error Resume Next
Dim datecntrl, Dy, Mo, Yr, nextmonth, startwith, thisMo, thisYr, thisDate,the_type
Dim prevMonthLastDate, currMonthLastDate, i, j, lastnum, AnyDate,default_value

datecntrl= Request("object")
default_value=request("value")
the_type=request("type")
if the_type<>"datetime" then
 the_type="date"
end if

if default_value="" then
 Yr = year(date)
 Mo = month(date)
 Dy = day(date)
else
    dim pos1
    dim deal_value
    deal_value=default_value
    pos1=instr(deal_value,"-")
 Yr = cint(mid(deal_value,1,pos1-1))
 deal_value=mid(deal_value,pos1+1)
 pos1=instr(deal_value,"-")
 Mo = cint(mid(deal_value,1,pos1-1))
 if trim(the_type)="date" then
  Dy = cint(mid(deal_value,pos1+1))
 else
     dim H,M,S
  deal_value=mid(deal_value,pos1+1)
  pos1=instr(deal_value," ")
     Dy=cint(mid(deal_value,1,pos1-1))
  deal_value=mid(deal_value,pos1+1)
  pos1=instr(deal_value,":")
     H=cint(mid(deal_value,1,pos1-1))
  deal_value=mid(deal_value,pos1+1)
  pos1=instr(deal_value,":")
     M=cint(mid(deal_value,1,pos1-1))
    S=cint(mid(deal_value,pos1+1))
 end if 
end if

nextmonth = false
%>
<HTML>
 <HEAD>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  <meta name="ProgId" content="FrontPage.Editor.Document">
  <style type="text/css">
 A
  { FONT-SIZE: 13px; COLOR: #000000;TEXT-DECORATION: none }
 A:hover
 {COLOR: #ff0000;
 }
  </style>
  <TITLE>日历</TITLE>
  <SCRIPT LANGUAGE="JavaScript">
 //检查字符串是否为日期,返回值:false、true
function f_chkDate(datestr)
{
 var lthdatestr
 if (datestr != "")
  lthdatestr= datestr.length ;
 else
  lthdatestr=0;
  
 var tmpy="";
 var tmpm="";
 var tmpd="";
 //var datestr;
 var status;
 status=0;
 if ( lthdatestr== 0)
  return false;

    if(lthdatestr>10)
       return false;
 
 for (i=0;i < lthdatestr;i++)
 { if (datestr.charAt(i)== '-')
  {
   status++;
  }
  if (status>2)
  {
   //alert("Invalid format of date!");
   return false;
  }
  if ((status==0) && (datestr.charAt(i)!='-'))
  {
   tmpy=tmpy+datestr.charAt(i)
  }
  if ((status==1) && (datestr.charAt(i)!='-'))
  {
   tmpm=tmpm+datestr.charAt(i)
  }
  if ((status==2) && (datestr.charAt(i)!='-'))
  {
   tmpd=tmpd+datestr.charAt(i)
  }

 }
 year=new String (tmpy);
 month=new String (tmpm);
 day=new String (tmpd);
 
 //tempdate= new String (year+month+day);
 //alert(tempdate);
 if ((tmpy.length!=4)

关键词:ASP+JavaScript的完整的日历运用




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版