没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|其它|编辑:郝浩|2007-10-18 10:33:07.000|阅读 1895 次
概述:
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
date.js
function draw(obj)
{
this.year = new Date().getFullYear();//取得年份
this.month = new Date().getMonth();//取得月份
this.date = new Date().getDate();//取得日期
this.result = "";
this.fday = "";
this.fdate = "";
this.ldate = "";
this.x=0;
this.y=0;
this.obj=obj;
this.YearSt = 1950;
this.YearEnd = 2050;
this.createTable(1);
}
draw.prototype.createTable=function(IsDiv)
{
this.fday=new Date(this.year,this.month,1).getDay();
this.fdate=1-this.fday;
this.ldate=new Date(this.year,this.month+1,0).getDate();
var str="";
if(IsDiv==1)
{
var str=" <div style= 'height:0px; width:0px; border:2 px; z-index:500; position:absolute;left:0px; top: 0px; z-index:5000; display:none ' id= 'Div'>";
}
str+=" <table style="+this.style+" >";
str+=" <tr >";
//显示年份的下拉框
str+=" <td style=font-size: 12px;color: #000000;line-height: 150%; >";
str+=" <select id=ddlYear onchange= 'YYchange(); ' style=margin:-2px >";
for(var i=this.YearSt;i <= this.YearEnd;i ++)
{
str+=" <option value=" + i + " >"+ i+ "年 </option >";
}
str+=" </select >";
str+=" </td >";
//显示月份的下拉框
str+=" <td style=font-size: 12px;color: #000000;line-height: 150%; >";
str+=" <select id=ddlMonth onchange= 'MMchange(); ' style=margin:-2px >";
for(var i=1;i <= 12;i ++)
{
str+=" <option value=" + (i-1) + " >"+ i+ "月 </option >";
}
str+=" </select >";
str+=" </td >";
str+=" </tr >";
str+=" </table >";
//显示年份,月份调节按钮
str+=" <table >";
str+=" <tr align=center >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >     </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand ' id=preYear onclick=perYear() >▲ </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >年 </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand 'id=nextYear onclick=nextYear() >▼ </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand ' id=showm > </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand ' id=preMonth onclick=preMonth() >▲ </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >月 </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand ' id=nextMonth onclick=nextMonth() >▼ </td >";
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;cursor:hand ' id=shown > </td >";
str+=" </tr >";
str+=" </table >";
//显示星期表头
str+= " <table border= '1 ' >";
str+= " <tr >";
str+= " <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >日 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >一 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >二 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >三 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >四 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >五 </td > <td style= 'font-size: 12px;color: #000000;line-height: 150%; ' >六 </td >";
str+= " </tr >";
str+= " </table >";
//显示日期
str+=" <table border= '1 'style=background-color:#CCCCCC; >";
for(var i=1,j=this.fdate;i <7;i++)
{
str+=" <tr >";
for(var k=0;k <7;k++)
{
if(this.isdate(j)=="")
{
str+=" <td style= 'font-size: 12px;color: #000000;line-height: 150%;";
}
else
{
str+=" <td d= '"+this.year+"-"+(parseInt(this.month)+1).toString()+"-"+this.isdate(j)+" ' onclick= 'getdate(d) ' style= 'font-size: 12px;color: #000000;line-height: 150%;";
}
if(j==this.date)
{
str+="BACKGROUND-COLOR:#60a0d5;COLOR: white;CURSOR: hand; ' >"//将当前日期设背景颜色
}
else
{
str+="CURSOR: hand; ' >"
}
str+=this.isdate(j++);
str+=" </td >";
}
str+=" </tr >";
}
str+=" </table >";
str+=" <table >"
str+=" <tr >";
str+=" <td style=font-size: 12px;color: #000000;line-height: 150%; >         </td >";
str+=" <td onclick=hide() style= 'font-size: 12px;color: #000000;line-height: 150%;CURSOR: hand; ' >"
str+="关闭";
str+=" </td >";
str+=" <td onclick=Clear() style= 'font-size: 12px;color: #000000;line-height: 150%;CURSOR: hand; ' >"
str+="清空";
str+=" </td >";
str+=" </tr >"
str+=" </table >";
if(IsDiv==1)
{
str+=" </div >";
}
this.result=str;
}
//查验日期的范围
draw.prototype.isdate=function(n)
{
// return (n >=1&&n <=ldate)?n:"";
if (n >=1&&n <=this.ldate)
{
return n;
}
else
{
return "";
}
}
var date=new draw();
date.createTable(1);
document.write(date.result);
show();
//年、月下拉框显示当前选中的年、月份
function show()
{
var ddlYear = document.getElementById("ddlYear");
var ddlMonth = document.getElementById("ddlMonth")
ddlYear.value=date.year;
ddlMonth.value=date.month;
}
//月下拉框改变事件
function MMchange()
{
var ddlMonth=document.getElementById("ddlMonth");
date.month=ddlMonth.value;
date.createTable();
var div=document.getElementById("Div");
div.innerHTML=date.result;
show();
}
//年下拉框改变事件
function YYchange()
{
var ddlYear=document.getElementById("ddlYear");
var div=document.getElementById("Div");
date.year=ddlYear.value;
date.createTable();
div.innerHTML=date.result;
show();
}
//上一年事件
function perYear()
{
if(date.year!=date.YearSt)
{
date.year--;
date.createTable();
var div=document.getElementById("Div");
div.innerHTML=date.result;
show();
}
}
//下一年事件
function nextYear()
{
if(date.year!=date.YearEnd)
{
date.year++;
date.createTable();
var div=document.getElementById("Div");
div.innerHTML=date.result;
show();
}
}
//上一月事件
function preMonth()
{
if(date.month!=0)
{
date.month--;
date.createTable();
var div=document.getElementById("Div");
div.innerHTML=date.result;
show();
}
}
//下一月事件
function nextMonth()
{
if(date.month!=11)
{
date.month++;
date.createTable();
var div=document.getElementById("Div");
div.innerHTML=date.result;
show();
}
}
//显示并定位
function showdate(oo)
{
date.obj=oo;
var div=document.getElementById("Div");
div.style.display="block";
div.style.left=window.event.x+"px";
div.style.top=window.event.y+"px";
CloseDiv();
}
//获取日期
function getdate(id)
{
(date.obj).value=id;
var div=document.getElementById("Div");
div.style.display="none";
}
//隐藏
function hide()
{
var div=document.getElementById("Div");
div.style.display="none";
}
//清空
function Clear()
{
date.obj.value = "";
hide();
}
//当点击日期控件外,日期控件关闭。
function CloseDiv()
{
var body=document;//.body;
body.onclick=function()
{
var div=document.getElementById("Div");
with(window.event.srcElement){
if (id != date.obj.id&&id != "Div"&&id != "ddlYear"&&id != "ddlMonth"&&id != "preMonth"&&id != "perYear"&&id != "nextYear"&&id != "nextMonth")
div.style.display="none";
}
}
}
主页
<html>
<head runat="server" >
<title >Untitled Page </title >
<script src="date.js" type="text/javascript"> </script >
<style type=text/css >
td
{
font-size: 12px;
color: #000000;
line-height: 150%;
}
</style >
</head >
<body >
<form id="form1" runat="server" >
<input type="text" readonly onclick=" showdate(this);" / >
</form >
</body >
</html >
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
文章转载自:csdn面对“数字中国”建设和中国制造2025战略实施的机遇期,中车信息公司紧跟时代的步伐,以“集约化、专业化、标准化、精益化、一体化、平台化”为工作目标,大力推进信息服务、工业软件等核心产品及业务的发展。在慧都3D解决方案的实施下,清软英泰建成了多模型来源的综合轻量化显示平台、实现文件不失真的百倍压缩比、针对模型中的大模型文件,在展示平台上进行流畅展示,提升工作效率,优化了使用体验。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号