<title>monthview demo</title>
<script language=javascript>
/*********************************** program features: Date selection
Features: javascript+html imitation of MonthView control in VB
Author: Ken
Contact: boboshu@21cn.com
Development Date: 2002-8-5
\***********************************/
var languagename= "cn"//Content Display language value: "cn" "en"
var currentmonth,currentyear
var nowdate,nowmonth,nowyear
D=new Date ();
Nowdate=d.getdate ()
Nowmonth=d.getmonth ()
Nowyear=d.getyear ()
Currentmonth=nowmonth
Currentyear=nowyear
ARRWEEKCAPTION_CN = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
Arrweekcaption_en = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
arrmonthcaption_cn= new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
arrmonthcaption_en= New Array ("January", "February", "March", "April", "may", "June", "July", "August", "September", " October "," November "," December ")
function MonthView () {}
/******************************* Initialization Control
\*******************************/
function Monthview.initialize () {
while (Tblshowday.rows.length>rowday) {
Tblshowday.deleterow (Rowday)
}
Firstday=new Date (currentyear,currentmonth,1)
Temprow=tblshowday.insertrow ()
Fill the previous date of the month, 1th *********
for (var j=0; J<firstday.getday (); j + +) {
Tempcell=temprow.insertcell ()
}
//*************************************
for (var i=1;i<=arrmonthcount[currentmonth]; i++) {
function Monthview.showcurrentdate (direction) {
if (direction== "preview") {
currentmonth--
if (currentmonth<0) {currentmonth=11; currentyear--}
}
if (direction== "next") {
currentmonth++
if (currentmonth>11) {currentmonth=0; currentyear++}
}
Monthview.setcurrentcaption ()
Monthview.bulidday ()
}
function Monthview.setlanguage (itsname) {
Languagename=itsname
Monthview.setcurrentcaption ()
Monthview.setweekcaption ()
Monthview.setshowhidetoday (True)
}
function Monthview.setcaptionbg (itscolor) {
Trcaption.style.background=itscolor
}
function Monthview.setborder (itsborder) {
Tblmonthview.style.border=itsborder
}
function Monthview.setlinecolor (itscolor) {
Tdline.style.background=itscolor
}
function Monthview.setshowhidetoday (flag) {
EL=TBLTODAY.ROWS[0].CELLS[1]
if (flag) {
if (languagename== "cn") {
El.innerhtml= "Today:" +nowyear+ "-" + (nowmonth+1) + "-" +nowdate
}else{
El.innerhtml= "Today:" +nowyear+ "-" + (nowmonth+1) + "-" +nowdate
}
el.style.display= "Block"
}else{
El.style.display= "None"
}
}
function Monthview.action () {
Please modify this function *********
monthview_value=currentyear+ "-" + (currentmonth+1) + "-" +this.innerhtml
Alert (Monthview_value)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.