📄 calendar.js
字号:
function calendar(t) {
var sPath = "../command/calendar1.htm";
strFeatures = "dialogWidth=206px;dialogHeight=208px;center=yes;help=no;status=no";
st = t.value;
sDate = showModalDialog(sPath,st,strFeatures);
t.value = formatDate(sDate, 0);
}
function checkDate(t) {
dDate = new Date(t.value);
if (dDate == "NaN") {t.value = ""; return;}
iYear = dDate.getFullYear()
if ((iYear > 1899)&&(iYear < 1950)) {
sYear = "" + iYear + ""
if (t.value.indexOf(sYear,1) == -1) {
iYear += 100
sDate = (dDate.getMonth() + 1) + "-" + dDate.getDate() + "-" + iYear
// sDate = (dDate.getMonth() + 1) + "," + dDate.getDate() + "," + iYear
dDate = new Date(sDate)
}
}
t.value = formatDate(dDate);
}
function formatDate(sDate) {
var sScrap = "";
var dScrap = new Date(sDate);
if (dScrap == "NaN") return sScrap;
iDay = dScrap.getDate();
iMon = dScrap.getMonth();
iYea = dScrap.getFullYear();
sScrap = iYea + "-" + d2(iMon + 1) + "-" + d2(iDay) ;
//sScrap = iYea + "," + d2(iMon + 1) + "," + d2(iDay) ;
return sScrap;
}
function d2(d) {
return ((d<10) ? "0"+d : d) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -