web前端|js教程
Js日期选择,自动填充,输入框
web前端-js教程
短信轰炸地址 源码,vscode选中变量,ubuntu复制根目录文件,tomcat 配置教程,sqlite 读取指定行,ec微信插件,你用过哪些前端框架,c佳加加爬虫,php c 扩展,淘宝运营seo,告白类网站源码,excel采集网页源码,自适用模板博客吧,京东订单中心页面代码,旅游管理系统源码下载,商城小程序前端框架lzw
微信砍价源码,vscode免费制作,红帽Ubuntu,tomcat下载asc,sqlite怎么创建编辑,列表导航插件,ssm框架怎么接收前端数据,我的世界爬虫迷宫,php 信息系统,安徽谷歌seo优化,朋友圈分享网站,如何用phpcms给一个网页添加后台,客户开发实例模板lzw
body{font-size:12px;font-family:Verdana,Arial,"宋体";}
a:link {color:#464646;text-decoration:none;}
a:visited {color:#464646;text-decoration:none;}
a:hover{color:#ed145b;text-decoration:underline;}
a:active{color:#ed145b;text-decoration:underline;}
td{font-size:12px}
/*/*/
/*DateCSS样式*/
.header {font: 12px Arial, Tahoma !important;font-weight: bold !important;font: 11px Arial, Tahoma;font-weight: bold;color: #154BA0;background:#C2DEED;height: 25px;padding-left: 10px;
}
.header td {padding-left: 10px;}
.header a {color: #154BA0;}
.header input {background:none;vertical-align: middle;height: 16px;}
.category {font: 12px Arial, Tahoma !important;font: 11px Arial, Tahoma;color: #92A05A;height:20px;background-color: #FFFFD9;}
.category td {border-bottom: 1px solid #DEDEB8;}
.expire, .expire a:link, .expire a:visited {color: #999999;}
.default, .default a:link, .default a:visited {color: #000000;}
.checked, .checked a:link, .checked a:visited {color: #FF0000;}
.today, .today a:link, .today a:visited {color: #00BB00;}
#calendar_year {display: none;line-height: 130%;background: #FFFFFF;position: absolute;z-index: 10;}
#calendar_year .col {float: left;background: #FFFFFF;margin-left: 1px;border: 1px solid #86B9D6;padding: 4px;}
#calendar_month {display: none;background: #FFFFFF;line-height: 130%;border: 1px solid #86B9D6;padding: 4px;position: absolute;z-index: 11;}
.tableborder {background: white;border: 1px solid #86B9D6;}
#year,#month{padding-right:10px;}
//下面的代码段如果你页面里有,可以去掉
var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
function $(objID){
return document.getElementById(objID);
}
-49源码,vscode中安装scss,ubuntu镜像很卡,tomcat关键技术,sqlite下载百度经验,想学爬虫语言哪里好一点,查看php 配置,保定seo服务运营公司,网站地图怎么设置,ios网页html模板下载工具lzw
var controlid = null;
var currdate = null;
var startdate = null;
var enddate = null;
var yy = null;
var mm = null;
var hh = null;
var ii = null;
var currday = null;
var addtime = false;
var today = new Date();
var lastcheckedyear = false;
var lastcheckedmonth = false;
function _cancelBubble(event) {
e = event ? event : window.event ;
if(ie) {
e.cancelBubble = true;
} else {
e.stopPropagation();
}
}
function getposition(obj) {
var r = new Array();
r[x] = obj.offsetLeft;
r[y] = obj.offsetTop;
while(obj = obj.offsetParent) {
r[x] += obj.offsetLeft;
r[y] += obj.offsetTop;
}
return r;
}
function loadcalendar() {
s = \;
s +=
;
if (ie)
{
s += \;
}
s +=
‘;///
s += ‘
‘;
for(var k = 1930; k <= ; k++) {
s += k != 1930 && k % 10 == 0 ? ‘
‘ : ”;
s += ” + k + ‘
‘;
}
s += ‘
‘;
s += ‘
‘;
for(var k = 1; k <= 12; k++) {
s += ” + k + ( k < 10 ? : \) + 月
‘;
}
s += ‘‘;
var nElement = document.createElement(“div”);
nElement.innerHTML=s;
document.getElementsByTagName(“body”)[0].appendChild(nElement);
//document.write(s);
document.onclick = function(event) {
$(‘calendar’).style.display = ‘none’;
$(‘calendar_year’).style.display = ‘none’;
$(‘calendar_month’).style.display = ‘none’;
}
$(‘calendar’).onclick = function(event) {
_cancelBubble(event);
$(‘calendar_year’).style.display = ‘none’;
$(‘calendar_month’).style.display = ‘none’;
}
}
function parsedate(s) {
/(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec(s);
var m1 = (RegExp.$1 && RegExp.$1 > 1899 && RegExp.$1 < 2101) ? parseFloat(RegExp.$1) : today.getFullYear();
var m2 = (RegExp.$2 && (RegExp.$2 > 0 && RegExp.$2 < 13)) ? parseFloat(RegExp.$2) : today.getMonth() + 1;
var m3 = (RegExp.$3 && (RegExp.$3 > 0 && RegExp.$3 < 32)) ? parseFloat(RegExp.$3) : today.getDate();
var m4 = (RegExp.$4 && (RegExp.$4 > -1 && RegExp.$4 < 24)) ? parseFloat(RegExp.$4) : 0;
var m5 = (RegExp.$5 && (RegExp.$5 > -1 && RegExp.$5 < 60)) ? parseFloat(RegExp.$5) : 0;
/(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec(“0000-00-00 00\:00”);
return new Date(m1, m2 – 1, m3, m4, m5);
}
function settime(d) {
$(‘calendar’).style.display = ‘none’;
controlid.value = yy + “-” + zerofill(mm + 1) + “-” + zerofill(d) + (addtime ? ‘ ‘ + zerofill($(‘hour’).value) + ‘:’ + zerofill($(‘minute’).value) : ”);
}
function showcalendar(event, controlid1, addtime1, startdate1, enddate1) {
controlid = controlid1;
addtime = addtime1;
startdate = startdate1 ? parsedate(startdate1) : false;
enddate = enddate1 ? parsedate(enddate1) : false;
currday = controlid.value ? parsedate(controlid.value) : today;
hh = currday.getHours();
ii = currday.getMinutes();
var p = getposition(controlid);
$(‘calendar’).style.display = ‘block’;
$(‘calendar’).style.left = p[‘x’]+’px’;
$(‘calendar’).style.top = (p[‘y’] + 20)+’px’;
_cancelBubble(event);
refreshcalendar(currday.getFullYear(), currday.getMonth());
if(lastcheckedyear != false) {
$(‘calendar_year_’ + lastcheckedyear).className = ‘default’;
$(‘calendar_year_’ + today.getFullYear()).className = ‘today’;
}
if(lastcheckedmonth != false) {
$(‘calendar_month_’ + lastcheckedmonth).className = ‘default’;
$(‘calendar_month_’ + (today.getMonth() + 1)).className = ‘today’;
}
$(‘calendar_year_’ + currday.getFullYear()).className = ‘checked’;
$(‘calendar_month_’ + (currday.getMonth() + 1)).className = ‘checked’;
$(‘hourminute’).style.display = addtime ? ” : ‘none’;
lastcheckedyear = currday.getFullYear();
lastcheckedmonth = currday.getMonth() + 1;
}
function refreshcalendar(y, m) {
var x = new Date(y, m, 1);
var mv = x.getDay();
var d = x.getDate();
var dd = null;
yy = x.getFullYear();
mm = x.getMonth();
$(“year”).innerHTML = yy;
$(“month”).innerHTML = mm + 1 > 9 ? (mm + 1) : ‘0’ + (mm + 1);
for(var i = 1; i <= mv; i++) {
dd = $(“d” + i);
dd.innerHTML = ” “;
dd.className = “”;
}
while(x.getMonth() == mm) {
dd = $(“d” + (d + mv));
dd.innerHTML = ” + d + ”;
if(x.getTime() enddate.getTime()) || (startdate && x.getTime() < startdate.getTime())) {
dd.className = ‘expire’;
} else {
dd.className = ‘default’;
}
if(x.getFullYear() == today.getFullYear() && x.getMonth() == today.getMonth() && x.getDate() == today.getDate()) {
dd.className = ‘today’;
dd.firstChild.title = ‘今天’;
}
if(x.getFullYear() == currday.getFullYear() && x.getMonth() == currday.getMonth() && x.getDate() == currday.getDate()) {
dd.className = ‘checked’;
}
x.setDate(++d);
}
while(d + mv <= 42) {
dd = $(“d” + (d + mv));
dd.innerHTML = ” “;
d++;
}
if(addtime) {
$(‘hour’).value = zerofill(hh);
$(‘minute’).value = zerofill(ii);
}
}
function showdiv(id) {
var p = getposition($(id));
$(‘calendar_’ + id).style.left = p[‘x’]+’px’;
$(‘calendar_’ + id).style.top = (p[‘y’] + 16)+’px’;
$(‘calendar_’ + id).style.display = ‘block’;
}
function zerofill(s) {
var s = parseFloat(s.toString().replace(/(^[\s0]+)|(\s+$)/g, ”));
s = isNaN(s) ? 0 : s;
return (s < 10 ? : \) + s.toString();
}
loadcalendar();
用法演示:
请选择日期: