<p> <yoy> td {font-family: "安体"; font-size:9pt}</style><body bgcolor="eeeeeeee"><table cellpadding="0" cellpacing="1" bgcolor="ddddddd" align=center><%'The following are the specific codes implemented in ASP through this calendar algorithm</p><p>'First determine whether a year and month are specified, and if no, it will be exibido com base no ano e mês atuais. Se solicitar ("reqdate") = "" então currentDate = date else currentDate = TRIM (request ("reqdate")) final se pyear = ano (currentDate) pmonth = mês (currentDate) </p> <p> 'O código a seguir gerar o conteúdo do cabeçalho da tabela para o calendar Display Deld Deld#<tling = "lear align = "Center"> <input type = "button" value = "<<" onclick = "javascript: location.href = '? reqdate = <%= dateAdd (" m ",-1, currentDate)%>'"> </td> <td colspan = "5" align = "center" <%nth </td> <td colspan = "5" align = "center" <%-1nth/pys %ntyn. align = "Center"> <input type = "button" value = ">>" onclick = "javascript: location.href = '? reqdate = <%= dateadd (" m ", 1, currentdate)%' '"> </td> </tr> <trituramento "" t) </tdd "tdd" tdd) </td> </tr> <td>one</td> <td>two</td> <td>three</td> <td>four</td> <td>five</td> <td>six</td> </tr> <tr align=center bgcolor=ffffff height=19> <% 'Since there is no function in ASP that specifies how many days there are in total for the specified month, we need to obtain it através de outros algoritmos. O algoritmo é realmente muito simples, que é calcular quantos dias há no total entre o 1º dia do mês a ser exibido do date = formatDateTime (mês (date date) & "/1/" e ano (currentdate)) para get Adate = formatdatETime (dATADD ("m", 1, de Data)) ')' get the week the week the the manderd ("m", 1, de Data)) ')' get) NUNMONTHSTART = dia da semana (FromDate) -1 'Obtenha o total entre o 1º dia do mês a ser exibido do 1º dia até o 1º dia do mês seguinte a ser exibido (quantos dias existem no total) Nunmonthend Days = Dateff (D ", Fromdate, Todate)' para determinar quantas fileiras de têxos são necessárias para exibir o calendário (DODATE) '7)' para determinar quantos linhas de bengala) nunmonthstart+nunmonthend<36 then maxi=36 else maxi=43 end if 'Change to generate the table and display i=1 do while i<maxi 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( "<td align = Center bgcolor = ffaaa>" & iv & "</td>") else Response.Write ("<td align = Center>" & iv & "</td>") end se a resposta se pode ser den ("<Td> </td>") end if </p> <p> 'se pode ser divis. Response.Write ("</tr> <tr align = Center bgcolor = ffffff altura = 19>") Fim se i = i+1 loop%> </ table> </body> [Ctrl+A Selecione All Note: Se você precisar introduzir JS externo, precisará atualizar para executar]