Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal estou tentando adptar um calendario em uma pagina mas estou tendo problemas, por favor me ajudem
a pagina é essa
quando clico no link do proximo mes, funciona beleza
mas quando clico no link do mes anterior não funciona.
da o seguinte erro:
Erro de tempo de execução do Microsoft VBScript erro '800a000d'
Tipos incompatíveis
/agenda.asp, line 250
calendario
<%
res=Request.QueryString("Show")
whichmonth=Request.QueryString("CurMonth")
whichyear=Request.QueryString("CurYear")
whataction=Request.QueryString("Action")
%>
<%
dim nextmonth
dim acalandardays(42)
nextmonth = 0
dbcurrentdate = date()
if res="Yes" then
whichdate="01" & "/" & whichmonth & "/" & whichyear
if whataction="Next" then
dbcurrentdate=dateadd("m",1,cdate(whichdate))
elseif whataction="Prev" then
dbcurrentdate=dateadd("m",-1,cdate(whichdate))
else
dbcurrentdate=dbcurrentdate(whichdate)
end if
end if
Dim dbcurrentdate
dim ifirstweekday
ifirstweekday = datepart("W",dateserial(year(dbcurrentdate),month(dbcurrentdate),1))
dim idaysinmonth
idaysinmonth = datepart("d",dateserial(year(dbcurrentdate),month(dbcurrentdate)+1,1-1))
dim iloop
for iloop = 1 to idaysinmonth
acalandardays(iloop+ifirstweekday-1)=iloop
next
dim icolumns,irows
icolumns = 7
irows = 6-int((42-(ifirstweekday+idaysinmonth))/7)
%>
<table width=45% height=45% border=1 align =center cellpadding="0" cellspacing = "0" bordercolor="#FFCC00" bgcolor="#FFFF99">
<tr></tr>
<th colspan=7 align="center" valign="middle" bgcolor=#FFCC00><a href="agenda.asp?Show=Yes&CurMonth=<%= left(curmonth,3)%>&CurYear=<%= curyear%>&Action= Prev" class="style38">Anterior</a>
<span class="style36">
<%
curmonth=monthname(month(dbcurrentdate))
Response.Write curmonth
curyear=year(dbcurrentdate)
Response.Write " " & curyear %>
</span> <span class="style35">
<a href="agenda.asp?Show=Yes&CurMonth=<%=left(curmonth,3)%>&CurYear=<%=curyear%>&Action=Next" class="style38">Próximo</a>
<%
Response.Write "<tr>"
Response.Write "<td align=center>"
Response.Write "<font color=#cc0000 >"
Response.Write "Domingo"
Response.Write "</font>"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Segunda"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Terça"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Quarta"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Quinta"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Sexta"
Response.Write "</td>"
Response.Write "<td color=#FFAF1C align=center>"
Response.Write "Sábado"
Response.Write "</td>"
Response.Write "</tr>"
%>
</font>
<%
dim irowsloop ,icolumnsloop
startday=weekday("01" & "/" & monthname(month(dbcurrentdate)) & "/" & year(dbcurrentdate))
ctr=1
for irowsloop = 1 to irows
Response.Write "<tr>"
if ctr=1 then
colm = startday
else
colm=1
end if
if startday>1 then
diff=colm - 1
end if
for icolumnsloop=colm to icolumns
if acalandardays((irowsloop-1)*7 +icolumnsloop) >= 0 then
if diff>0 then
for p=1 to diff
Response.Write "<td valign= top align=right width=""14%"">"
Response.Write "</td>"if res="Yes" then
whichdate="01" & "/" & whichmonth & "/" & whichyear
if whataction="Next" then
dbcurrentdate=dateadd("m",1,cdate(whichdate))
elseif whataction="Prev" then
dbcurrentdate=dateadd("m",-1,cdate(whichdate))
else
dbcurrentdate=dbcurrentdate(whichdate) <<< linha 250
end if
end if
--------------------------------------------------------------------------------------------------
Desde já agradeço pela ajuda de todos.
valeu!
Carregando comentários...