Js
<!--File name:calendar.jsp-->
<!--display a calendar of any year or month, you can choose a different year and month.
Author:wildfield-->
<%@ page language= "java" import= "java.util.*"%>
<%! String year;
String month;
%>
<% Month=request.getparameter ("month");
Year =request.getparameter ("year");
%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Day </title>
<script language= "JavaScript" >
<!--
function Changemonth ()
{
var mm= "calendar.jsp?month=" +document.sm.elements[0].selectedindex+ "&year="
+<%=year%>;
window.open (mm, "_self");
}
--></script>
<%! String days[]; %>
<%
Days=new string[42];
for (int i=0;i<42;i++)
{
Days= "";
}
%>
<%
Calendar thismonth=calendar.getinstance ();
if (month!=null&& (!month.equals ("null"))
Thismonth.set (Calendar.month, Integer.parseint (MONTH));
if (year!=null&& (!year.equals ("null"))
Thismonth.set (Calendar.year, Integer.parseint (year));
Year=string.valueof (Thismonth.get (calendar.year));
Month=string.valueof (Thismonth.get (calendar.month));
Thismonth.setfirstdayofweek (Calendar.sunday);
Thismonth.set (calendar.day_of_month,1);
int Firstindex=thismonth.get (Calendar.day_of_week)-1;
int Maxindex=thismonth.getactualmaximum (calendar.day_of_month);
for (int i=0;i<maxindex;i++)
{
Days[firstindex+i]=string.valueof (i+1);
}
%>
[1] [2] [3] Next page