ASPでは、カレンダーアルゴリズムにより実現される具体的なコード
2680 ワード
' ASP
' ,
If Request("ReqDate")="" then
CurrentDate=Date
else
CurrentDate=Trim(Request("ReqDate"))
end if
pyear=year(CurrentDate)
pmonth=month(CurrentDate)
'
%>
' ASP , , , 1 1
fromDate = FormatDateTime(month(CurrentDate) & "/1/" & year(CurrentDate))
toDate = FormatDateTime(DateAdd("m",1,fromDate))
'
nunmonthstart=weekday(fromDate)-1
' 1 1 ( )
nunmonthend=DateDiff("d",fromDate,toDate)
' ( 7 )
if nunmonthstart+nunmonthend<36 then
maxi=36
else
maxi=43
end if
'
i=1
do while i iv=i-nunmonthstart
if i>nunmonthstart and i<=nunmonthend+nunmonthstart then
'
if iv=Day(now) and month(now)=pmonth and year(now)=pyear then
response.write( " ")
else
response.write( "")
end if
else
response.write( "")
end if
' 7 ( 7 )
if i mod 7=0 then
response.write( "")
end if
i=i+1
loop
%>
'">
>" onclick="JavaScript:location.href='?ReqDate='">
「 & iv。 & " 「 & iv。 & "