当前位置:七道奇文章资讯网站建设网站编程
日期:2009-12-13 10:15:00  来源:本站整理

jsp中的时间挑选器的代码[网站编程]

赞助商链接



  本文“jsp中的时间挑选器的代码[网站编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

以下这个代码是我在开辟顶用的作为一个时间挑选器的空间,向数据库中插入日期的做法.

<script language="JavaScript">
var gdCtrl = new Object();
var gcGray = "#808080";
var gcToggle = "highlight";
var gcBG = "threedface";
var gMonths = new Array("一月","仲春","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十仲春");
var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
var sxYear = giYear;
var sxMonth = giMonth;
var sxDay = giDay;
var sxDatestr = gdCtrl.value;
if (sxDatestr != ""){
var sxDate = new Date(sxDatestr);
sxYear = sxDate.getFullYear();
}
var VicPopCal = new Object();
function mou搜索引擎优化ver(obj){
obj.style.borderTop = 'buttonshadow 1px solid';
obj.style.borderLeft = 'buttonshadow 1px solid';
obj.style.borderRight = 'buttonhighlight 1px solid';
obj.style.borderBottom = 'buttonhighlight 1px solid';
}
function mou搜索引擎优化ut(obj){
obj.style.borderTop = 'buttonhighlight 1px solid';
obj.style.borderLeft = 'buttonhighlight 1px solid';
obj.style.borderRight = 'buttonshadow 1px solid';
obj.style.borderBottom = 'buttonshadow 1px solid';
}
function mousedown(obj){
obj.style.borderTop = 'buttonshadow 1px solid';
obj.style.borderLeft = 'buttonshadow 1px solid';
obj.style.borderRight = 'buttonhighlight 1px solid';
obj.style.borderBottom = 'buttonhighlight 1px solid';
}
function mouseup(obj){
obj.style.borderTop = 'buttonhighlight 1px solid';
obj.style.borderLeft = 'buttonhighlight 1px solid';
obj.style.borderRight = 'buttonshadow 1px solid';
obj.style.borderBottom = 'buttonshadow 1px solid';
}
function fPopCalendar(popCtrl, dateCtrl, popCal){
parent.event.cancelBubble=true;
VicPopCal = popCal;
gdCtrl = dateCtrl;
fSetYearMon(giYear, giMonth);
var point = fGetXY(popCtrl);
with (VicPopCal.style) {left = point.x;top = point.y+popCtrl.offsetHeight+1;visibility = 'visible';}
VicPopCal.focus();
}
function fSetDate(iYear, iMonth, iDay){
if ((iYear == 0) && (iMonth == 0) && (iDay == 0)){
gdCtrl.value = "";
}
else{
if (iMonth < 10){iMonth = "0"+iMonth;}
if (iDay < 10){iDay = "0"+iDay;}
gdCtrl.value = iYear+"-"+iMonth+"-"+iDay;
}
VicPopCal.style.visibility = "hidden";
}
function fSetSelected(aCell){
var iOffset = 0;
var iYear = parseInt(document.all.tbSelYear.value);
var iMonth = parseInt(document.all.tbSelMonth.value);
aCell.bgColor = gcBG;
with (aCell.children["cellText"]){
var iDay = parseInt(innerText);
if (color==gcGray){iOffset = (Victor<10)?-1:1;}
iMonth += iOffset;
if (iMonth<1) { iYear--; iMonth = 12;}else{if (iMonth>12){iYear++;iMonth = 1;}}
}
fSetDate(iYear, iMonth, iDay);
}
function Point(iX, iY){this.x = iX;this.y = iY;}
function fBuildCal(iYear, iMonth){
var aMonth=new Array();
for(i=1;i<7;i++){aMonth[i]=new Array(i);}
var dCalDate=new Date(iYear, iMonth-1, 1);
var iDayOfFirst=dCalDate.getDay();
var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1;
var iDate = 1;
var iNext = 1;
for (d = 0; d < 7; d++){aMonth[1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++;}
for (w = 2; w < 7; w++){for (d = 0; d < 7; d++){aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++:-(iNext++);}}
  以上是“jsp中的时间挑选器的代码[网站编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:

  • JSP中衔接SQL 2000数据库的问题总结
  • JSP中Action属性的功效浅析
  • MYSQL,Oracle,SQL数据库在JSP中的驱动
  • <b>在JSP中拜候数据库大全</b>
  • jsp中的时间挑选器的代码
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .