<html>
<head>
<title>日期选择</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style>
BODY
{
BACKGROUND-COLOR: #DDEEFF;/*#d4d0c8;*/
font-size: 12px;
margin:0px;
border-left:1 solid ThreeDShadow;
border-top:1 solid ThreeDShadow;
}
label
{
FONT-FAMILY: webdings;
HEIGHT: 10px;
width:15px;
overflow:hiden;
font-size:5pt;
margin:0;
padding:0;
BACKGROUND-COLOR: #C8D6FB;
border-style:outset;
border-width:1;
border-left-width:0;
cursor:hand;
}
TD.Selected
{
font-size: 12px;
cursor:hand;
color:white;
BACKGROUND-COLOR: royalblue;
align:center ;
BORDER-BOTTOM: 1 inset;
BORDER-LEFT: 1 inset;
BORDER-RIGHT: 1 inset;
BORDER-TOP: 1 inset
}
TD.thisMonth
{
font-size: 12px;
cursor:hand;
align:center ;
BORDER-BOTTOM: 1 outset;
BORDER-LEFT: 1 outset;
BORDER-RIGHT: 1 outset;
BORDER-TOP: 1 outset
}
TD
{
font-size: 12px;
cursor:default;
align:center ;
BORDER-BOTTOM: 1 outset;
BORDER-LEFT: 1 outset;
BORDER-RIGHT: 1 outset;
BORDER-TOP: 1 outset
}
TD.Condition
{
font-size: 12px;
cursor:default;
align:center ;
BORDER-BOTTOM: 1 ;
BORDER-LEFT: 1 ;
BORDER-RIGHT: 1 ;
BORDER-TOP: 1
}
TD.PreMonth
{
font-size: 12px;
cursor:hand;
COLOR: #EEAA00;
align:center ;
BORDER-BOTTOM: 1 outset;
BORDER-LEFT: 1 outset;
BORDER-RIGHT: 1 outset;
BORDER-TOP: 1 outset
}
TD.NextMonth
{
font-size: 12px;
cursor:hand;
COLOR: #EEAA00;
align:center ;
BORDER-BOTTOM: 1 outset;
BORDER-LEFT: 1 outset;
BORDER-RIGHT: 1 outset;
BORDER-TOP: 1 outset
}
Input.ComboBox
{
height:20px;
font-size: 12px;
border: 1px solid #7F9DB9;
cursor:default;
border-right-width: 0;
}
INPUT.CheckBox {
border: 0px;
font-size: 12px;
cursor:default;
}
SELECT
{
font-size: 12px;
border:1px solid #ADAFF8;
background:transport;
}
</style>
<script language="JavaScript">
<!--
var onIntervalHandle;
var oTimeoutHandle;
//初始化
function Init()
{
self.dialogHeight=(thisTab.offsetHeight)/13.2;
self.dialogWidth=thisTab.offsetWidth/15.2;
// ListYears();
ListDays();
}
function ListPreMondth(theYear,theMonth,theCell)
{
var theRow;
if (theMonth==1)
{
theYear--;
theMonth=12;
}
else
theMonth--;
for(theDay=getDays(theYear,theMonth);theDay>=1;theDay--)
{
if (theCell==0)
break;
theRow=thisTab.rows(2);
theRow.cells(theCell-1).innerText=theDay;
theRow.cells(theCell-1).className="PreMonth";
theCell--;
}
}
//列出当前月份的天列表
function ListDays()
{
var theDat,today;
var theBegin;
var BeginRow=2,theRow;
var cellsID;
var theYear,theMonth;
if (!dataIsRight(cboYear.value,"年份"))
{
cboYear.value=cboYear.defaultValue;
ListDays();
return;
}
theYear=parseInt(cboYear.value);
theMonth=parseInt(cboMonth.value);
theRow=thisTab.rows(BeginRow);
theDate=new Date(theYear,theMonth-1,1);
today=theDate.getDay();
theBegin=theDate.getDay();
if (theBegin==0)
theBegin=7;
theBegin=theBegin-1;
theDate=new Date();
today=theDate.getDate();
ListPreMondth(theYear,theMonth,theBegin);
for(theDay=1;theDay<=getDays(theYear,theMonth);theDay++)
{
theRow=thisTab.rows(BeginRow);
theRow.cells(theBegin).innerText=theDay;
if (theDay==today)
{
theRow.cells(theBegin).className="Selected";
PreSelect=theRow.cells(theBegin);
PreClass="thisMonth";
}
else
theRow.cells(theBegin).className="thisMonth";
theBegin++;
if (theBegin==7)
{
theBegin=0;
BeginRow++;
}
}
ListNextMondth(theYear,theMonth,theBegin,BeginRow);
// labInfo.innerText=cboYear.value+"年"+cboMonth.options(cboMonth.selectedIndex).text;
}
//列出下月的天数列表
function ListNextMondth(theYear,theMonth,theCell,theRow)
{
var theCurRow;
if (theMonth==12)
{
theYear++;
theMonth=1;
}
else
theMonth++;
for(theDay=1;theDay<=getDays(theYear,theMonth);theDay++)
{
if (theRow==7 && theCell==7)
break;
if (theCell==7)
{
theCell=0;
theRow++;
}
theCurRow=thisTab.rows(theRow);
theCurRow.cells(theCell).innerText=theDay;
theCurRow.cells(theCell).className="NextMonth";
theCell++;
}
}
//初始化年份
function ListYears()
{
var theLen,theToday;
theToday=new Date();
/* for (theYear=1990;theYear<=2020;theYear++)
{
theLen=cboYear.length;
cboYear.length=theLen+1;
cboYear.options(theLen).value=theYear;
cboYear.options(theLen).text=theYear;
}*/
cboYear.value=theToday.getYear();
cboMonth.value=theToday.getMonth()+1;
cboH.value=(theToday.getHours()<10)?"0"+theToday.getHours():theToday.getHours();
cboM.value=(theToday.getMinutes()<10)?"0"+theToday.getMinutes():theToday.getMinutes();
cboS.value=(theToday.getSeconds()<10)?"0"+theToday.getSeconds():theToday.getSeconds();
oTimeoutHandle=setTimeout("ListYears()",1000);
}
//判断当前年份是否是润年
function CheckLoop(year)
{
var r1,r2;
r1=year/4;
r2=Math.round(year/4);
if (r1==r2)
return true;
else
return false;
r1=year/100;
r2=r2=Math.round(year/100);
if (r1==r2)
{
r1=year/400;
r2=r2=Math.round(year/400);
if (r1==r2)
return true;
else
return false;
}
r1=year/400;
r2=Math.round(year/400);
if (r1==r2)
return true;
else
return false;
}
//返回当前月分的天数
function getDays(theYear,theMonth)
{
if ( theMonth==1 || theMonth==3||theMonth==5 || theMonth==7 || theMonth==8 || theMonth==10 || theMonth==12)
return 31;
if ( theMonth==4 || theMonth==6||theMonth==9 || theMonth==11)
return 30;
if ( theMonth==2)
{
if (CheckLoop(theYear))
return 29;
else
return 28;
}
}
var PreSelect,PreClass="";
//单击日历
function getSelectedDay()
{
var theIndex,theYear,theMonth;
if (event.button==0 && event.srcElement.tagName=="TD")
{
theIndex=event.srcElement.parentElement.rowIndex;
if (theIndex>=2)
{
if (PreSelect!=null)
PreSelect.className=PreClass;
PreSelect=event.srcElement;
PreClass=event.srcElement.className;
event.srcElement.className="Selected";
}
}
}
//双击日历
function returnSelectedDay()
{
var theIndex,theYear,theMonth,theDay;
if (event.button==0 && event.srcElement.tagName=="TD")
{
theIndex=event.srcElement.parentElement.rowIndex;
if (theIndex>=2)
{
if (PreSelect!=null)
PreSelect.className=PreClass;
PreSelect=event.srcElement;
PreClass=event.srcElement.className;
event.srcElement.className="Selected";
theMonth=parseInt(cboMonth.value);
theYear=parseInt(cboYear.value);
if (PreClass=="NextMonth")
{
if (theMonth==12)
{
theYear++;
theMonth=1;
}
else
theMonth++;
}
if (PreClass=="PreMonth")
{
if (theMonth==1)
{
theYear--;
theMonth=12;
}
else
theMonth--;
}
if (theMonth<10)
theMonth="0"+theMonth;
theDay=PreSelect.innerText;
if (theDay.length==1)
theDay="0"+theDay;
returnValue=theYear+"-"+theMonth+"-"+theDay;
top.close();
/* if (oTime.checked)
parent.theDataObj.value=theYear+"-"+theMonth+"-"+theDay+" "+cboH.value+":"+cboM.value+":"+cboS.value;
else
parent.theDataObj.value=theYear+"-"+theMonth+"-"+theDay;
parent.oCalendarPopup.hide();
top.close();
*/
}
}
}
function setYear()
{
if(event.button==2)
return;
setYearAction(arguments[0],arguments[1]);
onIntervalHandle=window.setInterval("setYearAction('"+arguments[0]+"')",150);
}
function setYearAction()
{
try
{
theValue=parseFloat(
jsp_calendar.rar_JSP怎么做日历_calendar jsp_jsp calendar_jsp日历控件_日历
版权申诉
144 浏览量
2022-09-21
03:38:21
上传
评论
收藏 6KB RAR 举报
小波思基
- 粉丝: 70
- 资源: 1万+
最新资源
- 基于springboot+vue实现的在线考试系统+源代码+文档
- RTL8723DS 2022 版本 Linux驱动,android驱动 支持4.0-10x
- 要玩NDS的遊戲,必須要先下載三個bios檔案到你的檔案資料夾
- 各类型数据库4月排名,基于排名网站数据爬虫json结果
- 基于springboot+vue实现的在线考试系统+源代码+文档
- 淮北市杜集区人才补贴+生活补贴
- JAVA-JSP技术文档
- 课内实验02-决策表(共享单车月卡).docx
- 基于【React + Node+SpringBoot】疫情数据查看系统的设计与实现【源码+lw+部署+讲解】
- 基于【React + Node】云课堂系统设计与实现【源码+lw+部署+讲解】
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0