class calendar
dim calendarmonth,calendaryear,calendarday
dim today
dim table1
dim todayw
Private Sub Class_Initialize
today=date
set table1 = document.getElementById("calendartable")
end sub
function tableclear()
rowsnum=1
j=0
for i=0 to 41
table1.rows(rowsnum).cells(j).innerText=""
j=j+1
if j=7 then
j=0
rowsnum=rowsnum+1
end if
next
end function
public property get thedayd()
if len(calendarday)=0 then
calendarday=day(today)
end if
theyeard=calendaryear
end property
public property let thedayd(theday)
calendarday=theday
end property
public property get theyeard()
if len(calendaryear)=0 then
calendaryear=year(today)
end if
theyeard=calendaryear
end property
public property get themonthd()
if len(calendarmonth)=0 then
calendarmonth=month(today)
end if
themonthd=calendarmonth
end property
public property let theyeard(theyear)
calendaryear=theyear
end property
public property let themonthd(themonth)
calendarmonth=themonth
end property
function displayDay()
dim days,theday
dim d
dim rows
dim cells
rows=1
d = calendaryear&"-"&calendarmonth&"-"&"1"
todayw = Weekday(d)
select case calendarmonth
case 1
days=31
case 2
days=runnian(calendaryear)
case 3
days=31
case 4
days=30
case 5
days=31
case 6
days=30
case 7
days=31
case 8
days=31
case 9
days=30
case 10
days=31
case 11
days=30
case 12
days=31
end select
rowsnum=1
j=todayw-1
for i=1 to days
table1.rows(rowsnum).cells(j).innerText=i
j=j+1
if j=7 then
j=0
rowsnum=rowsnum+1
end if
next
end function
function runnian(theyear)
If theyear Mod 100 = 0 Then
If theyear Mod 4 = 0 Then
runnian=29
Else
runnian=28
End If
Else
If theyear Mod 4 = 0 Then
runnian=29
Else
runnian=28
End If
End If
end function
function addrecord(rowsnum,cellsnum,showday)
showday=replace(showday,"\","/")
showday="file:///"&showday
table1.rows(rowsnum-1).cells(cellsnum).innerHTML="<a href='"&showday&"'>"&table1.rows(rowsnum-1).cells(cellsnum).innerHTML&"</a>"
end function
end class