JS日历(带时间选择功能) kimsoft-jscalendar 增强版

最近做项目需要一个日历控件,可以选择时间功能,找了半天没有找到一个合适的,

手头有一个kimsoft-jscalendar的日历,此日历控件比较小,单文件18K(未压缩),但其没有时间选择功能,

于是着手进行改造,先上图:

哈哈应该可以满足大家的需要,代码如下:

Code:
  1. <!--   
  2. /**  
  3.  * Calendar  
  4.  * @param   beginYear           1990  
  5.  * @param   endYear             2010  
  6.  * @param   language            0(zh_cn)|1(en_us)|2(en_en)|3(zh_tw)|4(jp)  
  7.  * @param   patternDelimiter    "-"  
  8.  * @param   date2StringPattern  "yyyy-MM-dd"  
  9.  * @param   string2DatePattern  "ymd"  
  10.  * @version V20060401  
  11.  * @version V20061217  
  12.  * @version V20080809 add to google project  
  13.  * @version V20081226 add language support for japanese   
  14.  * @version V20090104 add fix some bugs in help.html  
  15.                       use style.display replace the style.visibility  
  16.                       some enhancements and changes  
  17.  * @author  KimSoft (jinqinghua [at] gmail.com)  
  18.  * NOTE!    you can use it free, but keep the copyright please  
  19.  * IMPORTANT:you must include this script file inner html body elment   
  20.  * @see http://code.google.com/p/kimsoft-jscalendar/  
  21.  */  
  22. function Calendar(beginYear, endYear, language, patternDelimiter, date2StringPattern, string2DatePattern,showTime) {   
  23.     this.showTime=showTime;   
  24.     this.beginYear = beginYear || 1990;   
  25.     this.endYear   = endYear   || 2020;   
  26.     this.language  = language  || 0;   
  27.     this.patternDelimiter = patternDelimiter     || "-";   
  28.     this.date2StringPattern = date2StringPattern || Calendar.language["date2StringPattern"][this.language].replace(//-/g, this.patternDelimiter);   
  29.     this.string2DatePattern = string2DatePattern || Calendar.language["string2DatePattern"][this.language];   
  30.        
  31.     this.dateControl = null;   
  32.     this.panel  = this.getElementById("__calendarPanel");   
  33.     this.iframe = window.frames["__calendarIframe"];   
  34.     this.form   = null;   
  35.        
  36.     this.date = new Date();   
  37.     this.year = this.date.getFullYear();   
  38.     this.month = this.date.getMonth();   
  39.     this.house = this.date.getHours();   
  40.     this.min = this.date.getMinutes();   
  41.     this.second=this.date.getSeconds();   
  42.   
  43.     this.colors = {"bg_cur_day":"#00CC33","bg_over":"#EFEFEF","bg_out":"#FFCC00"}   
  44. };   
  45.   
  46. Calendar.language = {   
  47.     "year"   : ["/u5e74""""""/u5e74","/u5e74"],   
  48.     "months" : [   
  49.                 ["/u4e00/u6708","/u4e8c/u6708","/u4e09/u6708","/u56db/u6708","/u4e94/u6708","/u516d/u6708","/u4e03/u6708","/u516b/u6708","/u4e5d/u6708","/u5341/u6708","/u5341/u4e00/u6708","/u5341/u4e8c/u6708"],   
  50.                 ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],   
  51.                 ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],   
  52.                 ["/u4e00/u6708","/u4e8c/u6708","/u4e09/u6708","/u56db/u6708","/u4e94/u6708","/u516d/u6708","/u4e03/u6708","/u516b/u6708","/u4e5d/u6708","/u5341/u6708","/u5341/u4e00/u6708","/u5341/u4e8c/u6708"],   
  53.                 ["/u4e00/u6708","/u4e8c/u6708","/u4e09/u6708","/u56db/u6708","/u4e94/u6708","/u516d/u6708","/u4e03/u6708","/u516b/u6708","/u4e5d/u6708","/u5341/u6708","/u5341/u4e00/u6708","/u5341/u4e8c/u6708"]                  
  54.                 ],   
  55.     "weeks"  : [["/u65e5","/u4e00","/u4e8c","/u4e09","/u56db","/u4e94","/u516d"],   
  56.                 ["Sun","Mon","Tur","Wed","Thu","Fri","Sat"],   
  57.                 ["Sun","Mon","Tur","Wed","Thu","Fri","Sat"],   
  58.                 ["/u65e5","/u4e00","/u4e8c","/u4e09","/u56db","/u4e94","/u516d"],   
  59.                 ["/u65e5","/u6708","/u706b","/u6c34","/u6728","/u91d1","/u571f"],   
  60.             ],   
  61.     "clear"  : ["/u6e05/u7a7a""Clear""Clear""/u6e05/u7a7a""/u524a/u9664"],   
  62.     "today"  : ["/u4eca/u5929""Today""Today""/u4eca/u5929""/u4eca/u65e5"],   
  63.     "close"  : ["/u5173/u95ed""Close""Close""/u95dc/u9589""/u623b/u308b"],   
  64.     "date2StringPattern" : ["yyyy-MM-dd""yyyy-MM-dd""yyyy-MM-dd""yyyy-MM-dd""yyyy-MM-dd"],   
  65.     "string2DatePattern" : ["ymd","ymd""ymd""ymd""ymd"]   
  66. };   
  67.   
  68. Calendar.prototype.draw = function() {   
  69.     calendar = this;   
  70.        
  71.     var _cs = [];   
  72.     _cs[_cs.length] = '<form id="__calendarForm" name="__calendarForm" method="post">';   
  73.     _cs[_cs.length] = '<table id="__calendarTable" width="100%" border="0" cellpadding="3" cellspacing="1" align="center">';   
  74.     _cs[_cs.length] = ' <tr>';   
  75.     _cs[_cs.length] = '  <th><input class="l" name="goPrevMonthButton" type="button" id="goPrevMonthButton" value="<" //><//th>';   
  76.     _cs[_cs.length] = '  <th colspan="5"><select class="year" name="yearSelect" id="yearSelect"><//select><select class="month" name="monthSelect" id="monthSelect"><//select><//th>';   
  77.     _cs[_cs.length] = '  <th><input class="r" name="goNextMonthButton" type="button" id="goNextMonthButton" value=">" //><//th>';   
  78.     _cs[_cs.length] = ' <//tr>';   
  79.     _cs[_cs.length] = ' <tr>';   
  80.     for(var i = 0; i < 7; i++) {   
  81.         _cs[_cs.length] = '<th class="theader">';   
  82.         _cs[_cs.length] = Calendar.language["weeks"][this.language][i];   
  83.         _cs[_cs.length] = '<//th>';    
  84.     }   
  85.     _cs[_cs.length] = '<//tr>';   
  86.     for(var i = 0; i < 6; i++){   
  87.         _cs[_cs.length] = '<tr align="center">';   
  88.         for(var j = 0; j < 7; j++) {   
  89.             switch (j) {   
  90.                 case 0: _cs[_cs.length] = '<td class="sun"> <//td>'break;   
  91.                 case 6: _cs[_cs.length] = '<td class="sat"> <//td>'break;   
  92.                 default:_cs[_cs.length] = '<td class="normal"> <//td>'break;   
  93.             }   
  94.         }   
  95.         _cs[_cs.length] = '<//tr>';   
  96.     }   
  97.     _cs[_cs.length] = ' <tr id="trTime"><td colspan="5">';   
  98.     _cs[_cs.length] = ' <select  id=ddlyear name=ddlhouse></select>:<select id=ddlmin name=ddlmin></select>:<select id=ddlsec name=ddlsec></select>';   
  99.     _cs[_cs.length] = ' <//td><td colspan="2"><input type="button" class="b" name="okButton" id="okButton" value="确定" //><//td>';   
  100.     _cs[_cs.length] = ' <//td><//tr>';   
  101.     _cs[_cs.length] = ' <tr>';   
  102.     _cs[_cs.length] = '  <th colspan="2"><input type="button" class="b" name="clearButton" id="clearButton" //><//th>';   
  103.     _cs[_cs.length] = '  <th colspan="3"><input type="button" class="b" name="selectTodayButton" id="selectTodayButton" //><//th>';   
  104.     _cs[_cs.length] = '  <th colspan="2"><input type="button" class="b" name="closeButton" id="closeButton" //><//th>';   
  105.     _cs[_cs.length] = ' <//tr>';   
  106.     _cs[_cs.length] = '<//table>';   
  107.     _cs[_cs.length] = '<//form>';   
  108.        
  109.     this.iframe.document.body.innerHTML = _cs.join("");   
  110.     this.form = this.iframe.document.forms["__calendarForm"];   
  111.     for(var i=0;i<=23;i++){   
  112.         var n=(i<10)?"0"+i:i;   
  113.         this.form.ddlhouse.options[this.form.ddlhouse.length] = new Option(n, i);   
  114.     }   
  115.     for(var i=0;i<=59;i++){   
  116.         var n=(i<10)?"0"+i:i;   
  117.         this.form.ddlmin.options[this.form.ddlmin.length] = new Option(n,i );   
  118.         this.form.ddlsec.options[this.form.ddlsec.length] = new Option(n,i );   
  119.     }   
  120.     this.form.ddlsec.οnchange=this.form.ddlhouse.οnchange=this.form.ddlmin.οnchange=function(){   
  121.         calendar.updateDate(calendar.date.getDate());   
  122.     };   
  123.        
  124.     this.form.clearButton.value = Calendar.language["clear"][this.language];   
  125.     this.form.selectTodayButton.value = Calendar.language["today"][this.language];   
  126.     this.form.closeButton.value = Calendar.language["close"][this.language];   
  127.        
  128.     this.form.goPrevMonthButton.onclick = function () {calendar.goPrevMonth(this);}   
  129.     this.form.goNextMonthButton.onclick = function () {calendar.goNextMonth(this);}   
  130.     this.form.yearSelect.onchange = function () {calendar.update(this);}   
  131.     this.form.monthSelect.onchange = function () {calendar.update(this);}   
  132.        
  133.     this.form.clearButton.onclick = function () {calendar.dateControl.value = "";calendar.hide();}   
  134.     this.form.okButton.οnclick=function(){ calendar.dateControl.value = calendar.date.format(calendar.date2StringPattern);calendar.hide();}   
  135.     this.form.closeButton.onclick = function () {calendar.hide();}   
  136.     this.form.selectTodayButton.onclick = function () {   
  137.         var today = new Date();   
  138.         calendar.date = today;   
  139.         calendar.year = today.getFullYear();   
  140.         calendar.month = today.getMonth();   
  141.         calendar.house = today.getHours();   
  142.         calendar.min = today.getMinutes();   
  143.         calendar.second=today.getSeconds();   
  144.         calendar.dateControl.value = today.format(calendar.date2StringPattern);   
  145.         calendar.hide();   
  146.     }   
  147. };   
  148.   
  149. Calendar.prototype.bindYear = function() {   
  150.     var ys = this.form.yearSelect;   
  151.     ys.length = 0;   
  152.     for (var i = this.beginYear; i <= this.endYear; i++){   
  153.         ys.options[ys.length] = new Option(i + Calendar.language["year"][this.language], i);   
  154.     }   
  155. };   
  156.   
  157. Calendar.prototype.bindMonth = function() {   
  158.     var ms = this.form.monthSelect;   
  159.     ms.length = 0;   
  160.     for (var i = 0; i < 12; i++){   
  161.         ms.options[ms.length] = new Option(Calendar.language["months"][this.language][i], i);   
  162.     }   
  163. };   
  164.   
  165. Calendar.prototype.goPrevMonth = function(e){   
  166.     if (this.year == this.beginYear && this.month == 0){return;}   
  167.     this.month--;   
  168.     if (this.month == -1) {   
  169.         this.year--;   
  170.         this.month = 11;   
  171.     }   
  172.     this.updateDate();   
  173.     this.changeSelect();   
  174.     this.bindData();   
  175. };   
  176.   
  177. Calendar.prototype.goNextMonth = function(e){   
  178.     if (this.year == this.endYear && this.month == 11){return;}   
  179.     this.month++;   
  180.     if (this.month == 12) {   
  181.         this.year++;   
  182.         this.month = 0;   
  183.     }   
  184.     this.updateDate();   
  185.     this.changeSelect();   
  186.     this.bindData();   
  187. };   
  188.   
  189. Calendar.prototype.changeSelect = function() {   
  190.     var ys = this.form.yearSelect;   
  191.     var ms = this.form.monthSelect;   
  192.     for (var i= 0; i < ys.length; i++){   
  193.         if (ys.options[i].value == this.date.getFullYear()){   
  194.             ys[i].selected = true;   
  195.             break;   
  196.         }   
  197.     }   
  198.     for (var i= 0; i < ms.length; i++){   
  199.         if (ms.options[i].value == this.date.getMonth()){   
  200.             ms[i].selected = true;   
  201.             break;   
  202.         }   
  203.     }   
  204. };   
  205.   
  206. Calendar.prototype.updateDate = function (n){   
  207.     if(!n)   
  208.         n=1;   
  209.     if(this.showTime){   
  210.         var h=this.form.ddlhouse;   
  211.         this.houre=h.options[h.selectedIndex].value;   
  212.         h=this.form.ddlmin;   
  213.         this.min=h.options[h.selectedIndex].value;   
  214.         h=this.form.ddlsec;   
  215.         this.second=h.options[h.selectedIndex].value;   
  216.         this.date = new Date(this.year, this.month, n,this.house,this.min,this.second);   
  217.     }   
  218.     else  
  219.         this.date = new Date(this.year, this.month, 1);   
  220. };   
  221. Calendar.prototype.update = function (e){   
  222.     this.year  = e.form.yearSelect.options[e.form.yearSelect.selectedIndex].value;   
  223.     this.month = e.form.monthSelect.options[e.form.monthSelect.selectedIndex].value;       
  224.     this.updateDate();   
  225.     this.changeSelect();   
  226.     this.bindData();   
  227. };   
  228. Calendar.prototype.bindData = function () {   
  229.     var calendar = this;   
  230.     var dateArray = this.getMonthViewDateArray(this.date.getFullYear(), this.date.getMonth());   
  231.     var tds = this.getElementsByTagName("td"this.getElementById("__calendarTable"this.iframe.document));   
  232.     var trs = this.getElementsByTagName("tr"this.getElementById("__calendarTable"this.iframe.document));   
  233.     var panel=this.getElementById("__calendarPanel");   
  234.     if(this.showTime){   
  235.         panel.style.height="236px";   
  236.     }   
  237.     else{   
  238.         panel.style.height="216px";   
  239.         trs[8].style.display="none";   
  240.     }   
  241.     this.form.ddlhouse.selectedIndex=this.house-1;   
  242.     this.form.ddlmin.selectedIndex=this.min-1;   
  243.     this.form.ddlsec.selectedIndex=this.sec-1;   
  244.     for(var i = 0; i < tds.length-2; i++) {   
  245.         tds[i].style.backgroundColor = calendar.colors["bg_over"];   
  246.         tds[i].onclick = null;   
  247.         tds[i].onmouseover = null;   
  248.         tds[i].onmouseout = null;   
  249.         tds[i].innerHTML = dateArray[i] || " ";           
  250.         if (i > dateArray.length - 1) continue;   
  251.         if (dateArray[i]){   
  252.             tds[i].onclick = function () {   
  253.                 if (calendar.dateControl){     
  254.                     var date=new Date(calendar.date.getFullYear(),   
  255.                                         calendar.date.getMonth(),   
  256.                                         this.innerHTML,   
  257.                                         calendar.date.getHours(),calendar.date.getMinutes(),   
  258.                                         calendar.date.getSeconds());   
  259.                     calendar.dateControl.value = date.format(calendar.date2StringPattern);   
  260.                 }   
  261.                 calendar.hide();   
  262.             }   
  263.             tds[i].onmouseover = function () {this.style.backgroundColor = calendar.colors["bg_out"];}   
  264.             tds[i].onmouseout  = function () {this.style.backgroundColor = calendar.colors["bg_over"];}   
  265.             var today = new Date();   
  266.             if (today.getFullYear() == calendar.date.getFullYear()) {   
  267.                 if (today.getMonth() == calendar.date.getMonth()) {   
  268.                     if (today.getDate() == dateArray[i]) {   
  269.                         tds[i].style.backgroundColor = calendar.colors["bg_cur_day"];   
  270.                         tds[i].onmouseover = function () {this.style.backgroundColor = calendar.colors["bg_out"];}   
  271.                         tds[i].onmouseout  = function () {this.style.backgroundColor = calendar.colors["bg_cur_day"];}   
  272.                     }   
  273.                 }   
  274.             }   
  275.         }//end if   
  276.     }//end for   
  277. };   
  278.   
  279. Calendar.prototype.getMonthViewDateArray = function (y, m) {   
  280.     var dateArray = new Array(42);   
  281.     var dayOfFirstDate = new Date(y, m, 1).getDay();   
  282.     var dateCountOfMonth = new Date(y, m + 1, 0).getDate();   
  283.     for (var i = 0; i < dateCountOfMonth; i++) {   
  284.         dateArray[i + dayOfFirstDate] = i + 1;   
  285.     }   
  286.     return dateArray;   
  287. };   
  288.   
  289. Calendar.prototype.show = function (dateControl, popuControl,showTime) {   
  290.     this.showTime=(showTime);   
  291.     if(this.showTime){   
  292.         this.date2StringPattern="yyyy-MM-dd hh:mm:ss";   
  293.         this.string2DatePattern="ymdhms";   
  294.     }   
  295.     else{   
  296.             this.date2StringPattern="yyyy-MM-dd";   
  297.     }   
  298.     if (this.panel.style.display == "block") {   
  299.         this.panel.style.display = "none";   
  300.     }   
  301.     if (!dateControl){   
  302.         throw new Error("arguments[0] is necessary!")   
  303.     }   
  304.     this.dateControl = dateControl;   
  305.     popuControl = popuControl || dateControl;   
  306.   
  307.     this.draw();   
  308.     this.bindYear();   
  309.     this.bindMonth();   
  310.     if (dateControl.value.length > 0){   
  311.         this.date  = new Date(dateControl.value.toDate(this.patternDelimiter, this.string2DatePattern));           
  312.         this.year  = this.date.getFullYear();   
  313.         this.month = this.date.getMonth();         
  314.         this.house = this.date.getHours();   
  315.         this.min = this.date.getMinutes();   
  316.         this.second = this.date.getSeconds();   
  317.     }   
  318.     this.changeSelect();   
  319.     this.bindData();   
  320.   
  321.     var xy = this.getAbsPoint(popuControl);   
  322.     this.panel.style.left = xy.x + "px";   
  323.     this.panel.style.top = (xy.y + dateControl.offsetHeight) + "px";   
  324.     this.panel.style.display = "block";   
  325. };   
  326.   
  327. Calendar.prototype.hide = function() {   
  328.     this.panel.style.display = "none";   
  329. };   
  330.   
  331. Calendar.prototype.getElementById = function(id, object){   
  332.     object = object || document;   
  333.     return document.getElementById ? object.getElementById(id) : document.all(id);   
  334. };   
  335.   
  336. Calendar.prototype.getElementsByTagName = function(tagName, object){   
  337.     object = object || document;   
  338.     return document.getElementsByTagName ? object.getElementsByTagName(tagName) : document.all.tags(tagName);   
  339. };   
  340.   
  341. Calendar.prototype.getAbsPoint = function (e){   
  342.     var x = e.offsetLeft;   
  343.     var y = e.offsetTop;   
  344.     while(e = e.offsetParent){   
  345.         x += e.offsetLeft;   
  346.         y += e.offsetTop;   
  347.     }   
  348.     return {"x": x, "y": y};   
  349. };   
  350.   
  351. /**  
  352.  * @param   d the delimiter  
  353.  * @param   p the pattern of your date  
  354.  * @author  meizz  
  355.  * @author  kimsoft add w+ pattern  
  356.  */  
  357. Date.prototype.format = function(style) {   
  358.     var o = {   
  359.         "M+" : this.getMonth() + 1, //month   
  360.         "d+" : this.getDate(),      //day   
  361.         "h+" : this.getHours(),     //hour   
  362.         "m+" : this.getMinutes(),   //minute   
  363.         "s+" : this.getSeconds(),   //second   
  364.         "w+" : "/u65e5/u4e00/u4e8c/u4e09/u56db/u4e94/u516d".charAt(this.getDay()),   //week   
  365.         "q+" : Math.floor((this.getMonth() + 3) / 3),  //quarter   
  366.         "S"  : this.getMilliseconds() //millisecond   
  367.     }   
  368.     if (/(y+)/.test(style)) {   
  369.         style = style.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));   
  370.     }   
  371.     for(var k in o){   
  372.         if (new RegExp("("+ k +")").test(style)){   
  373.             style = style.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));   
  374.         }   
  375.     }   
  376.     return style;   
  377. };   
  378.   
  379. /**  
  380.  * @param d the delimiter  
  381.  * @param p the pattern of your date  
  382.  * @rebuilder kimsoft  
  383.  * @version build 2006.12.15  
  384.  */  
  385. String.prototype.toDate = function(delimiter, pattern) {   
  386.     delimiter = delimiter || "-";   
  387.     pattern = pattern || "ymd";   
  388.     if(pattern=="ymd"){   
  389.         var a = this.split(delimiter);   
  390.         var y = parseInt(a[pattern.indexOf("y")], 10);   
  391.         if(y.toString().length <= 2) y += 2000;   
  392.         if(isNaN(y)) y = new Date().getFullYear();   
  393.         var m = parseInt(a[pattern.indexOf("m")], 10) - 1;   
  394.         var d = parseInt(a[pattern.indexOf("d")], 10);   
  395.         if(isNaN(d)) d = 1;   
  396.         return new Date(y, m, d);   
  397.     }   
  398.     //2001-01-01 01:02:03   
  399.     var y=this.substr(0,4);   
  400.     var m=this.substr(5,2);   
  401.     var d=this.substr(8,2);   
  402.     var h=this.substr(11,2);   
  403.     var mm=this.substr(14,2);   
  404.     var s=this.substr(17,2);   
  405.     var date=new Date(y,m-1,d,h,mm,s);   
  406.     return date;   
  407. };   
  408.   
  409. var divs = [];   
  410. divs[divs.length] = '<div id="__calendarPanel" style="position:absolute;display:none;background-color:#FFFFFF;border:1px solid #666666;width:200px;height:236px;">';   
  411. divs[divs.length] = '<iframe name="__calendarIframe" id="__calendarIframe" width="100%" height="100%" scrolling="no" frameborder="0" style="margin:0px;"><//iframe>';   
  412. divs[divs.length] = '<//div>';   
  413. document.write(divs.join(""));   
  414.   
  415. var __ci = window.frames['__calendarIframe'];   
  416. var cis = [];   
  417. cis[cis.length] ='<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http:www.w3.org//TR//xhtml1//DTD//xhtml1-transitional.dtd">';   
  418. cis[cis.length] ='<html xmlns="http:www.w3.org//1999//xhtml">';   
  419. cis[cis.length] ='<head>';   
  420. cis[cis.length] ='<meta http-equiv="Content-Type" content="text//html; charset=utf-8" //>';   
  421. cis[cis.length] ='<title>Web Calendar(UTF-8) Written By KimSoft<//title>';   
  422. cis[cis.length] ='<style type="text//css">';   
  423. cis[cis.length] ='<!--';   
  424. cis[cis.length] ='body {font-size:12px;margin:0px;text-align:center;}';   
  425. cis[cis.length] ='form {margin:0px;}';   
  426. cis[cis.length] ='select {font-size:12px;background-color:#EFEFEF;}';   
  427. cis[cis.length] ='table {border:0px solid #CCCCCC;background-color:#FFFFFF}';   
  428. cis[cis.length] ='th {font-size:12px;font-weight:normal;background-color:#FFFFFF;}';   
  429. cis[cis.length] ='th.theader {font-weight:normal;background-color:#666666;color:#FFFFFF;width:24px;}';   
  430. cis[cis.length] ='select.year {width:64px;}';   
  431. cis[cis.length] ='select.month {width:60px;}';   
  432. cis[cis.length] ='td {font-size:12px;text-align:center;}';   
  433. cis[cis.length] ='td.sat {color:#0000FF;background-color:#EFEFEF;}';   
  434. cis[cis.length] ='td.sun {color:#FF0000;background-color:#EFEFEF;}';   
  435. cis[cis.length] ='td.normal {background-color:#EFEFEF;}';   
  436. cis[cis.length] ='input.l {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:20px;height:20px;}';   
  437. cis[cis.length] ='input.r {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:20px;height:20px;}';   
  438. cis[cis.length] ='input.b {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:100%;height:20px;}';   
  439. cis[cis.length] ='-->';   
  440. cis[cis.length] ='<//style>';   
  441. cis[cis.length] ='<//head>';   
  442. cis[cis.length] ='<body>';   
  443. cis[cis.length] ='<//body>';   
  444. cis[cis.length] ='<//html>';   
  445. __ci.document.writeln(cis.join(""));   
  446. __ci.document.close();   
  447. var calendar = new Calendar();   
  448. //-->  

使用方法,无时间: οnclick="calendar.show(this,null);"

有时间:οnclick="calendar.show(this,null,true);"

希望对大家有用处!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 21
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 21
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值