📄 yscalendar.js
字号:
function dayMouseOver(){this.className = "over";}function dayMouseOut(){this.className = "out";var d = YCalendar.day[this.id.substr(5)], a = d.split("/");if( d == YCalendar.inputDate){this.className = "over";}}function returnDate(){if(YCalendar.objExport){toCtrole(YCalendar.day[this.id.substr(5)]);}}function toCtrole(dayvalue){ var returnValue; var a = dayvalue.split("/"); var d = YCalendar.format.match(/^(\w{4})(-|\/|.|)(\w{1,2})\2(\w{1,2})$/); if(d==null){alert("你设定的日期输出格式不对!\r\n\r\n请重新定义 YCalendar.format !"); return false;} var flag = d[3].length==2 || d[4].length==2; returnValue = flag ? a[2] +d[2]+ appendZero(a[1]) +d[2]+ appendZero(a[0]) : a[2] +d[2]+ a[1] +d[2]+ a[0]; if (YCalendar.useGb){ var a = returnValue.split("-"); a[1]=charReplace(a[1],'0','',''); a[1]=charReplace(a[1],'1','十',''); a[2]=charReplace(a[2],'10','十',''); a[2]=charReplace(a[2],'12','十二',''); a[2]=charReplace(a[2],'13','十三',''); a[2]=charReplace(a[2],'20','廿十',''); a[2]=charReplace(a[2],'21','廿一',''); a[2]=charReplace(a[2],'30','三十',''); a[2]=charReplace(a[2],'31','三十一',''); a[2]=charReplace(a[2],'0','',''); if(a[2].length==2){a[2]=charReplace(a[2],'1','十','');} if(a[2].length==2){a[2]=charReplace(a[2],'2','廿','');} returnValue=a[0]+'年'+a[1]+'月'+a[2]; returnValue=charReplace(returnValue,'0','○','g');returnValue=charReplace(returnValue,'1','一','g'); returnValue=charReplace(returnValue,'2','二','g'); returnValue=charReplace(returnValue,'3','三','g'); returnValue=charReplace(returnValue,'4','四','g'); returnValue=charReplace(returnValue,'5','五','g'); returnValue=charReplace(returnValue,'6','六','g'); returnValue=charReplace(returnValue,'7','七','g'); returnValue=charReplace(returnValue,'8','八','g'); returnValue=charReplace(returnValue,'9','九','g'); } YCalendar.objExport.value = returnValue; Hide();}function prevM(){YCalendar.thisDay = 1;if (YCalendar.thisMonth==1){YCalendar.thisYear--;YCalendar.thisMonth=13;}YCalendar.thisMonth--;printCalendar();}function nextM(){YCalendar.thisDay = 1;if (YCalendar.thisMonth==12){YCalendar.thisYear++;YCalendar.thisMonth=0;}YCalendar.thisMonth++;printCalendar();}function funYearSelect(){var y = isNaN(parseInt(YCalendar.thisYear, 10)) ? new Date().getFullYear() : parseInt(YCalendar.thisYear);var n = YCalendar.yearFall;if(YCalendar.minYear==''||YCalendar.minYear==0)YCalendar.minYear=1956;if(YCalendar.maxYear==''||YCalendar.maxYear==0)YCalendar.maxYear=2056;var cDocument=YCalendar.frmobj.contentWindow.document;var e = cDocument.getElementById('tmpYearSelect');if(e.options.length<1){for (var i=YCalendar.minYear; i<=YCalendar.maxYear; i++) e.options.add(new Option(i, i));}e.style.display = ""; e.value = y; e.focus();}function funMonthSelect(){var m = isNaN(parseInt(YCalendar.thisMonth, 10)) ? new Date().getMonth() + 1 : parseInt(YCalendar.thisMonth);var cDocument=YCalendar.frmobj.contentWindow.document;var e = cDocument.getElementById('tmpMonthSelect');if(e.options.length<1){for (var i=1; i<13; i++) e.options.add(new Option(i, i));}e.style.display = ""; e.value = m; e.focus();}function selectM(obj){YCalendar.thisMonth =obj.value;hiddenSelect(obj);printCalendar();}function prevY(){YCalendar.thisDay = 1; YCalendar.thisYear--; printCalendar();}function nextY(){YCalendar.thisDay = 1; YCalendar.thisYear++; printCalendar();}function hiddenSelect(e){e.style.display="none";}function appendZero(n){return(("00"+ n).substr(("00"+ n).length-2));}function charReplace(strobj,objchar,ordcar,flage){re = new RegExp(objchar,flage);returnValue = strobj.replace(re, ordcar);return returnValue;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -