小日历 - asp实例

作者:袖梨 2022-07-02

<%
Function CountDays(iMonth,iYear)
Select Case iMonth
case 1,3,5,7,8,10,12
CountDays=31
case 2
if IsDate("2/29/" & iYear) Then
CountDays=29
else
CountDays=28
end if
case 4,6,9,11
CountDays=30
End Select
End Function
Function FirstDay(iMonth,iYear)
FirstDay=WeekDay(iMonth & "/1/" & iYear)
End Function
dim mMonth,mYear
mMonth=Month(Date())
mYear=Year(Date())
mDate=Day(Date())
response.write "
" & mYear & "年" & mMonth & "月" & "

"
%>
星期日星期一星期二星期三星期四星期五星期六
"
if i>=FirstDay(mMonth,mYear) and j<=CountDays(mMonth,mYear) then
if mDate=j then
response.write "" & j & " "
else
response.write j
end if
j=j+1
else
response.write "   "
end if
response.write "

相关文章

精彩推荐