如果在文本框中插入年月日?支持源码下载,重宇科技,让网页更精彩,让世界发现你


点击次数: 次 发布时间:2013-1-19


o.display = ""; WebCalendar.iframe.document.body.focus();
var cw = WebCalendar.calendar.clientWidth, ch = WebCalendar.calendar.clientHeight;
var dw = document.body.clientWidth, dl = document.body.scrollLeft, dt = document.body.scrollTop;

if (document.body.clientHeight + dt - t - h >= ch) o.top = (p=="image")? t + h : t + h + 6;
else o.top = (t - dt < ch) ? ((p=="image")? t + h : t + h + 6) : t - ch;
if (dw + dl - l >= cw) o.left = l; else o.left = (dw >= cw) ? dw - cw + dl : dl;
if (!WebCalendar.timeShow) WebCalendar.dateReg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;
else WebCalendar.dateReg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
try{
if (WebCalendar.objExport.value.trim() != ""){
WebCalendar.dateStyle = WebCalendar.objExport.value.trim().match(WebCalendar.dateReg);
if (WebCalendar.dateStyle == null)
{
WebCalendar.thisYear = new Date().getFullYear();
WebCalendar.thisMonth = new Date().getMonth()+ 1;
WebCalendar.thisDay = new Date().getDate();
alert("原文本框里的日期有错误!\n可能与你定义的显示时分秒有冲突!");
writeCalendar(); return false;
}
else
{
WebCalendar.thisYear = parseInt(WebCalendar.dateStyle[1], 10);
WebCalendar.thisMonth = parseInt(WebCalendar.dateStyle[3], 10);
WebCalendar.thisDay = parseInt(WebCalendar.dateStyle[4], 10);
WebCalendar.inputDate = parseInt(WebCalendar.thisDay, 10) +"/"+ parseInt(WebCalendar.thisMonth, 10) +"/"+
parseInt(WebCalendar.thisYear, 10); writeCalendar();
}
} else writeCalendar();
} catch(e){writeCalendar();}
}
function funMonthSelect() //月份的下拉框
{
var m = isNaN(parseInt(WebCalendar.thisMonth, 10)) ? new Date().getMonth() + 1 : parseInt(WebCalendar.thisMonth);
var e = WebCalendar.iframe.document.forms[0].tmpMonthSelect;
for (var i=1; i<13; i++) e.options.add(new Option(i +"月", i));
e.style.display = ""; e.value = m; e.focus(); window.status = e.style.top;
}
function funYearSelect() //年份的下拉框
{
var n = WebCalendar.yearFall;
var e = WebCalendar.iframe.document.forms[0].tmpYearSelect;
var y = isNaN(parseInt(WebCalendar.thisYear, 10)) ? new Date().getFullYear() : parseInt(WebCalendar.thisYear);
y = (y <= 1000)? 1000 : ((y >= 9999)? 9999 : y);
var min = (y - n >= 1000) ? y - n : 1000;
var max = (y + n <= 9999) ? y + n : 9999;
min = (max == 9999) ? max-n*2 : min;
max = (min == 1000) ? min+n*2 : max;
for (var i=min; i<=max; i++) e.options.add(new Option(i +"年", i));
e.style.display = ""; e.value = y; e.focus();
}
function prevM() //往前翻月份
{
WebCalendar.thisDay = 1;
if (WebCalendar.thisMonth==1)
{
WebCalendar.thisYear--;
WebCalendar.thisMonth=13;
}
WebCalendar.thisMonth--; writeCalendar();
}
function nextM() //往后翻月份
{
WebCalendar.thisDay = 1;
if (WebCalendar.thisMonth==12)
{
WebCalendar.thisYear++;
WebCalendar.thisMonth=0;
}
WebCalendar.thisMonth++; writeCalendar();
}
作者天宇科技 - 如果在文本框中插入年月日?支持源码下载,重宇科技,让网页更精彩,让世界发现你

本文地址:http://www.tianyv.net/News_Show_52_1.html   手机地址http://www.tianyv.net/Mobile/News_Show_52_1.html

版权所有 © 转载时必须以链接形式注明作者和原始出处!
相关文章
关于我们
关于我们
企业文化
最新资讯
核心服务
品牌形象
邢台网站建设
邢台网站优化
成功案例
品牌设计
公司成功案例
邢台网站优化
解决方案
邢台网络公司
邢台网站维护
邢台网络营销
招贤纳士
加入我们
学习发展
常见问题
联系我们
联系我们
我要留言
如何合作
首页
手机网站
FLASH版
旧版邢台网络公司
本站关键词邢台网站建设邢台网站制作邢台网站设计,交换链接QQ:830044 链接要求:pr>=3,百度快照三天内。