boas pessoal estou a fazer um calendário em java mas já empenei pois não sei o que ei de por para o meu calendário ir de mês para mês!!!
<script type="text/javascript">
<!--
now = new Date();
nowDay = now.getDay();
nowDate = now.getDate();
nowMonth = now.getMonth() + 1;
nowYear = new String(now.getYear());
nowyearLen = nowYear.length
nowYear = nowYear.split("")
nowYear = nowYear[nowyearLen - 2] + nowYear[nowyearLen - 1]
j = 31;
startDate = 1;
tmpDate = nowDate;
tmpDay = nowDay;
start = false;
end = false;
monthName = new Array();
monthName[1] = "Janeiro";
monthName[2] = "Fevereiro";
monthName[3] = "Março";
monthName[4] = "Abril";
monthName[5] = "Maio";
monthName[6] = "Junho";
monthName[7] = "Julho";
monthName[8] = "Agosto";
monthName[9] = "Setembro";
monthName[10] = "Outubro";
monthName[11] = "Novembro";
monthName[12] = "Dezembro";
monthLen = new Array();
monthLen[1] = "31";
monthLen[2] = "28";
monthLen[3] = "31";
monthLen[4] = "30";
monthLen[5] = "31";
monthLen[6] = "30";
monthLen[7] = "31";
monthLen[8] = "31";
monthLen[9] = "30";
monthLen[10] = "31";
monthLen[11] = "30";
monthLen[12] = "31";
for (i = 0; i < j; i++){
tmpDate;
tmpDay;
if (tmpDay < 0){
tmpDay = 6;
}
if (tmpDate == 1){
i = 31;
}
}
document.write("<table border='0' class='calendario_estrutura'><tr><td><table><tr>")
document.write("<td class='calendario_mes'>" + monthName[nowMonth] + ' 20' + nowYear + "</td>")
document.write("</tr></table><table><tr class='calendario_semana'>")
document.write("<td>D</td><td>S</td><td>T</td><td>Q</td><td>Q</td><td>S</td><td>S</td></tr><tr>")
for (i = 0; i < 7; i++){
for (week = 0; week <= 6; week++){
if (startDate == nowDate){
document.write("<td class='calendario_hoje'>")
}
else{
document.write("<td class='calendario_dia'>")
}
if (week == tmpDay){
start = true
}
if ((start == true)&&(end == false)){
document.write(startDate)
startDate++
}
if (startDate == nowDate){
document.write("")
}
document.write("</td>")
if (startDate > monthLen[nowMonth]){
end = true
}
}
document.write("</tr>")
}
document.write("</tr></table></td></tr></table>");
//-->
</script>
eu gostava que tivesse uma seta de cala lado do mês para ir para o próximo ou mesmo o anterior: exemplo < Maio >, ao clicar no direito ele vai para Junho , e assim sucessivamente....
agradecia se alguém poder me ajudar
ATE