日期:2014-05-18  浏览次数:20729 次

时间日期控件,新手提问
我想在JSP页面上加载个时间日期选择控件,但是不知道该怎么做,请高手给我我个思路吧.......我实在不知道怎么先开始.......

我现在做一个输入框需要输入日期
____________ <==(这个是输入框,然后旁边加载个时间控件)[控件]
我点这个[控件]可以选择日期,然后在输入框上可以显示选择好的日期

这个我该怎么做,请高手指教.........

------解决方案--------------------
var s_tiannet_turn_base = "height:16px;font-size:9pt;color:white;border:0 solid #CCCCCC;cursor:hand;background-color:#2650A6; ";
var s_tiannet_turn = "width:28px; " + s_tiannet_turn_base;
var s_tiannet_turn2 = "width:22px; " + s_tiannet_turn_base;
var s_tiannet_select = "width:64px;display:none; ";
var s_tiannet_select2 = "width:46px;display:none; ";
var s_tiannet_body = "width:150;background-color:#2650A6;display:none;z-index:9998;position:absolute; " +
"border-left:1 solid #CCCCCC;border-top:1 solid #CCCCCC;border-right:1 solid #999999;border-bottom:1 solid #999999; ";
var s_tiannet_day = "width:21px;height:20px;background-color:#D8F0FC;font-size:10pt; ";
var s_tiannet_font = "color:#FFCC00;font-size:9pt;cursor:hand; ";
var s_tiannet_link = "text-decoration:none;font-size:9pt;color:#2650A6; ";
var s_tiannet_line = "border-bottom:1 solid #6699CC ";
var tiannetYearSt = 1950;//可选择的开始年份
var tiannetYearEnd = 2010;//可选择的结束年份
var tiannetDateNow = new Date();
var tiannetYear = tiannetDateNow.getFullYear(); //定义年的变量的初始值
var tiannetMonth = tiannetDateNow.getMonth()+1; //定义月的变量的初始值
var tiannetDay = tiannetDateNow.getDate();
var tiannetHour = 8;//tiannetDateNow.getHours();
var tiannetMinute = 0;//tiannetDateNow.getMinutes();
var tiannetArrDay=new Array(42); //定义写日期的数组
var tiannetDateSplit = "- "; //日期的分隔符号
var tiannetDateTimeSplit = " "; //日期与时间之间的分隔符
var tiannetTimeSplit = ": "; //时间的分隔符号
var tiannetOutObject; //接收日期时间的对象
var arrTiannetHide = new Array();//被强制隐藏的标签
var m_bolShowHour = false;//是否显示小时
var m_bolShowMinute = false;//是否显示分钟

var m_aMonHead = new Array(12); //定义阳历中每个月的最大天数
m_aMonHead[0] = 31; m_aMonHead[1] = 28; m_aMonHead[2] = 31; m_aMonHead[3] = 30; m_aMonHead[4] = 31; m_aMonHead[5] = 30;
m_aMonHead[6] = 31; m_aMonHead[7] = 31; m_aMonHead[8] = 30; m_aMonHead[9] = 31; m_aMonHead[10] = 30; m_aMonHead[11] = 31;
//用户主调函数-只选择日期
function setDay(obj){
tiannetOutObject = obj;
if(tiannetOutObject.value== " ")
{
tiannetYear = tiannetDateNow.getFullYear();
tiannetMonth = tiannetDateNow.getMonth()+1;
tiannetDay = tiannetDateNow.getDate();
tiannetSetValue(true);
}
else
{
var strValue = tiannetTrim(tiannetOutObject.value);
if( strValue != " " ){
tiannetInitDate(strValue);
}
}
tiannetPopCalendar();
}
function setYearPeriod(intDateBeg,intDateEnd){
tiannetYearSt = intDateBeg;
tiannetYearEnd = intDateEnd;
}
function setDateSplit(strDateSplit){
tiannetDateSplit = strDateSplit;
}
function setSplit(strDateSplit,strDateTimeSplit,strTimeSplit){
tiannetDateSplit(strDateSplit);
tiannetDateTimeSplit(strDateTimeSplit);
tiannetTimeSplit(strTimeSplit);
}
function setDefaultDate(strDate){
tiannetYear = strDate.substring(0,4);
tiannetMonth = strDate.substring(5,7);
tiannetDay = strDate.substring(8,10);
}
var weekName = new Array( "日 ", "一 ", "二 ", "三 ", "四 ", "五 ", "六 ");
document.write( ' <div id= "divTiannetDate " style= " '+s_tiannet_body+ &