A very practical little thing about date selection.

Source: Internet
Author: User
Tags date
Date Selection <%
' Day.asp
%>
<title> Select Date </title>
<style type=text/css>
<!--
Body{margin:0;font-size:9pt;color: #5E639B}
Td{font-size:9pt;color: #000000}
a:link {color: #000000; Text-decoration:none}
a:visited {color: #000000; Text-decoration:none}
a:active {color: #000000; Text-decoration:none}
a:hover {color: #ff3333; Text-decoration:none}
-->
</style>
<script language= "JavaScript" >
function Getday (v) {
Window.opener.document.<%=request.querystring ("form")%>.<%=request.querystring ("field")%>.value=v;
Window.close ();
return false;
}
</Script>
<body bgcolor= #ffffff onblur= "Window.focus ()" >
<%
Olddate=request ("Olddate")
If not isDate (olddate) then olddate=date
Yy=year (CDate (olddate))
Mm=month (CDate (olddate))
If request ("yy") <> "" Then Yy=request ("yy")
If request ("MM") <> "" Then Mm=request ("MM")
If yy= "" then yy=year (date)
If mm= "" then Mm=month (date)
If Mm>12 then mm=1:yy=yy+1
If Mm<1 then mm=12:yy=yy-1

Dim m (12)
M (1) =31
M (3) =31
M (5) =31
M (7) =31
M (8) =31
M (10) =31
M (12) =31
M (2) =28
M (4) =30
M (6) =30
M (9) =30
M (11) =30
if (yy mod 4=0 and yy mod 100<>0) or yy mod 400=0 then M (2) =29
Mms=m (mm)
Week1= (Weekday (CDate (yy & "-" & mm & "-1"))-1
%>
<table width=250 cellspacing=1 cellpadding=0 bgcolor= #FFDFDF align=center>
<tr>
&LT;TD colspan=7 align=center>
<table width=100% height=20 cellspacing=0 cellpadding=0>
<tr height=20>
&LT;TD width=30 align=center>
<a href=day.asp?form=<%=request ("form")%>&field=<%=request ("field")%>&yy=<%= (yy-1)% >&mm=<%=mm%>>
<font face=webdings style=color: #000000 title= "last year" >7</font>
</a>
&LT;TD width=30 align=center>
<a href=day.asp?form=<%=request ("form")%>&field=<%=request ("field")%>&mm=<%= (mm-1)% >&yy=<%=yy%>>
<font face=webdings style=color: #000000 title= "Last month" >3</font>
</a>
&LT;TD width=130 align=center style= "font:9pt verdana,geneva,sans-serif;color: #CD0101" >
<b><%=yy%> year <%=mm%> Month </b>
&LT;TD width=30 align=center>
<a href=day.asp?form=<%=request ("form")%>&field=<%=request ("field")%>&mm=<%= (mm+1)% >&yy=<%=yy%>>
<font face=webdings style=color: #000000 title= "next month" >4</font>
</a>
&LT;TD width=30 align=center>
<a href=day.asp?form=<%=request ("form")%>&field=<%=request ("field")%>&yy=<%= (yy+1)% >&mm=<%=mm%>>
<font face=webdings style=color: #000000 title= "next year" >8</font>
</a>
</table>
<tr bgcolor= #ffffff height=20>
&LT;TD width=35 align=center bgcolor= #FFF4F4 style=color: #ff6633 > Day
&LT;TD width=35 align=center bgcolor= #FFF4F4 > A
&LT;TD width=35 align=center bgcolor= #FFF4F4 > II
&LT;TD width=35 align=center bgcolor= #FFF4F4 > three
&LT;TD width=35 align=center bgcolor= #FFF4F4 > Four
&LT;TD width=35 align=center bgcolor= #FFF4F4 > Five
&LT;TD width=35 align=center bgcolor= #FFF4F4 > VI
<%
If Week1<>0 Then
Response.Write "<tr>"
For I=1 to Week1
Response.Write "<td width=35 height=20 bgcolor= #ffffff >"
Next
End If
For I=1 to MMS
if (i+week1-1) mod 7=0 then Response.Write "<tr>"
Response.Write "<td width=35 height=20 align=center bgcolor= #ffffff >"
If CDate (yy & "-" & mm & "-" & I) =date () Then
%>
<input Type=button value=<%=i%>
Style= "BORDER: #CD0101 1px groove;width:30;heigh



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.