Year / Yearly Calendar JSP Script

Year Calendar script that displays the dates / months for an entire year. Simple Yearly / 12 Month calendar that can be used in any website. It has been tested to work in browsers like mozilla, IE, opera.

Features

  • Free Yearly Calendar which is easy to integrate in to any website or web page.
  • Customizable background color and font size.
  • Featured calender that also highlights the current day of the year.
  • Great for personal use, business, organizations, schools, etc.

Preview

1 Year/12 Month Calendar Script

Click here to see the yearly calendar

Yearly Calendar

Downloads


<%@ page import="java.util.Calendar"%> <%
String bgcolor = "#232323";
String tablecolor = "#104881";
String fontcolor = "#c9c9c9";
String tableborder = "#446655";Calendar cal = Calendar.getInstance();
int year
= cal.get(Calendar.YEAR);
String[] months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; %> <%!
public String startRow(String color) {
return "<tr bgcolor=\"+color+"\">";
}public String startMainRow() {
return "<tr>";
}public String endMainRow() {
return "</tr>";
}public String createElement(int x, String color) {
if(x==0) {
return "<td></td>";
} else {
return "<td align=\"center\"><font color=\"+color+"\" size=\"-1\"><b>"+x+"</b></font></td>";
}
}public String createElement(int x,String color, int bg) {
return "<td align=\"center\" bgcolor=\"#001100\" ><font color=\"+color+"\">"+x+"</font></td>";
}
public String endRow() {
return "</tr>";
}public String startMonth(String bgcolor,String mname) {return "<td valign=\"top\"><table><tr><td align=\"center\"><font color=\"#c9c9c9\">"+mname+"</font></td></tr><tr width=\"250\" height=\"100\"><td height=\"100\" width=\"250\"><table color=\"446655\" bgcolor=\"+bgcolor+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" height=\"100\" width=\"250\"><tr align=\"center\" bgcolor=\"#505050\"><td><font size=\"-1\"><b>Sun</b></font></td><td><font size=\"-1\"><b>Mon</b></font></td><td><font size=\"-1\"><b>Tue</b></font></td><td><font size=\"-1\"><b>Wed</b></font></td><td><font size=\"-1\"><b>Thu</b></font></td><td><font size=\"-1\"><b>Fri</b></font></td><td><font size=\"-1\"><b>Sat</b></font></td></tr>";
}public String endMonth() {
return "</table></td></tr></table></td>";
} %> <script type="text/javascript"> function ctck() {
var sds = document.getElementById("dum");
if(sds == null){
alert("You are using a free package.\n You are not allowed to remove the tag.\n");
}
var sdss = document.getElementById("dumdiv");
if(sdss == null){
alert("You are using a free package.\n You are not allowed to remove the tag.\n");
} } document.onload="ctck()"; </script> <table style="border: 2px solid rgb(0, 0, 0); color:446655;" bgcolor="<%= bgcolor%>" border="0" cellspacing="1" height="500" width="800">
<tr width="800" height="10">
<td colspan="3" style="border-bottom: 0px solid rgb(255, 255, 255);" align="center" width="800">
<font color="<%= fontcolor%>"><b><%= year %></b></font></td>
<td style="border-bottom: 0px solid rgb(255, 255, 255);" align="center" width="5">
</td></tr> <%

int day_of_month = cal.get(Calendar.DAY_OF_MONTH);
int start = day_of_month;
int start_month = cal.get(Calendar.MONTH);

cal.set(year, 0, 1);
int month = -1;
int cmonth = 0;
int dow = cal.get(Calendar.DAY_OF_WEEK);

int i=1;while(cal.get(Calendar.YEAR) == year) {
day_of_month = cal.get(Calendar.DAY_OF_MONTH);
cmonth = cal.get(Calendar.MONTH);
dow = cal.get(Calendar.DAY_OF_WEEK);

if(month != cmonth) {
month = cmonth;

if(month!=0) {
for(i=dow;i<=7;i++) {
out.println(createElement(0,fontcolor));
}
out.println(endRow());
out.println(endMonth());
}
else
out.println(startMainRow());

if((month%3) ==0 ) {
out.println(endMainRow());
out.println(startMainRow());
}
out.println(startMonth(bgcolor,months[month]));
out.println(startRow(tablecolor));
for(i=1;i<dow;i++) {
out.println(createElement(0,fontcolor));
}
}

if((dow == 1) && (day_of_month !=1)) {
out.println(startRow(tablecolor));

}
if(day_of_month==start && month == start_month)
out.println(createElement(day_of_month,fontcolor,1));
elseout.println(createElement(day_of_month,fontcolor));if(dow == 7)
out.println(endRow());cal.add(Calendar.DAY_OF_MONTH, 1);
}
dow = cal.get(Calendar.DAY_OF_WEEK);
if(dow==1) {
out.println(endRow());
out.println(endMainRow());

} else {
for(i=dow;i<=7;i++) {
out.println(createElement(0,fontcolor));
}
out.println(endRow());
out.println(endMainRow());
}
%> </table>
<div align=center style="font-size: 10px;color: #dadada;" id="dumdiv"> <a href="//www.hscripts.com" id="dum" style="text-decoration:none;color: #dadada;">©H</a></div>
  • Release Date - 12-02-2010
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Just Copy and Paste the code given in your webpage to display the 12 month calendar.
  • You can change the font color, table color, table border, background color, simply by editing the respective variables.
  • The yearly calendar script is compatible with all modern web browsers.

License

Related Scripts

Free Jsp Scripts


Ask Questions

Ask Question