We often need some of the Web projects used in the calendar, such a script to write trouble, not powerful enough, now tofu to everyone
Provides a powerful calendar program that uses a full client-side JS script to run faster.
Let's take a look at the following, there is any need to improve the place, first see the effect of it! Calendar Demo
<HTML>
<HEAD>
<TITLE> Tofu Calendar </TITLE>
<style type= "Text/css" >
. Normal{background: #ffffff}
. Today {font-weight:bold; BACKGROUND: #6699cc}
. Satday{color:green}
. sunday{color:red}
. Days {Font-weight:bold}
</STYLE>
<script language= "JavaScript" >
In Chinese month, if you want to display the English month, revise the following comment
/*var months = new Array ("January?," February?, "March",
"April", "may", "June", "July", "August", "September",
"October", "November", "December");
var months = new Array ("January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December");
var daysinmonth = new Array (31, 28, 31, 30, 31, 30, 31, 31,
30, 31, 30, 31);
If you want to display English, revise the following comment
/*var days = new Array ("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");
var days = new Array ("Day", "one", "two", "three"),
"Four", "five", "six");
function getdays (month, year) {
The following code is to determine whether the current is a leap year
if (1 = month)
Return ((0 = year% 4) && (0!= (year% 100)) | |
(0 = year% 400)? 29:28;
Else
return Daysinmonth[month];
}
function Gettoday () {
Get today's year, month, day
This.now = new Date ();
This.year = This.now.getFullYear ();
This.month = This.now.getMonth ();
This.day = This.now.getDate ();
}
Today = new Gettoday ();
function Newcalendar () {
Today = new Gettoday ();
var parseyear = parseint (document.all.year
[Document.all.year.selectedindex].text);
var newcal = new Date (Parseyear,
Document.all.month.selectedIndex, 1);
var day =-1;