欢迎来到天天文库
浏览记录
ID:10203026
大小:28.00 KB
页数:4页
时间:2018-06-12
《js javascript 生成时间日期下拉列表》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、JSJavaScript生成时间日期下拉列表
2、hosedyear=InputArgArray[1];//修正值(年份)varselmonthname=InputArgArray[2];//生成下拉列表的id名字(月份)varchosedmonth=InputArgArray[3];//修正值(月份)varseldayname=InputArgArray[4];//生成下拉列表的id名字(日)varchosedday=InputArgArray[5];//修正值(日)//varbeginyear=InputArgArray[6];//开始年份(修正值,和当前年份)-10//varendyear=
3、InputArgArray[7];//结束年份(修正值,和当前年份)+5varargumenetslength=InputArgArray.length;varoutstr="";//输出字符串varbegin_year=1999;//开始年vartoday=newDate();if(argumenetslength==6){//复杂类型//年月日//年份outstr+='4、e+'',''+selmonthname+'',''+seldayname+'')">';vartodayyear=today.getYear();todayyear=todayyear<1900?(todayyear+1900):todayyear;varEnd_year=todayyear+10;//if(chosedyear!=null&&chosedyear!='')//{//todayyear+=chosedyear;//}for(vari=begin_year;i<=End_year;i++){if(i==todayyear)5、{outstr=outstr+''+i+'年';}else{outstr=outstr+''+i+'年';}}outstr=outstr+'';//月份outstr=outstr+'6、,''+selmonthname+'',''+seldayname+'')">';vartodaymonth=today.getMonth()+1;for(i=1;i<=12;i++){if(i==todaymonth){outstr=outstr+''+FnFormatLessTen(i)+'月';}else{outstr=outstr+'7、)+'">'+FnFormatLessTen(i)+'月';}}outstr=outstr+'';//日期outstr+='';vartodayday=today.getDate();varnewdate=newDate(todayyear,todaymonth);vardatenum=newdate.getUTCDate();for(i=1;i<=datenum;i++){if(i==todayday){outstr8、=outstr+'
4、e+'',''+selmonthname+'',''+seldayname+'')">';vartodayyear=today.getYear();todayyear=todayyear<1900?(todayyear+1900):todayyear;varEnd_year=todayyear+10;//if(chosedyear!=null&&chosedyear!='')//{//todayyear+=chosedyear;//}for(vari=begin_year;i<=End_year;i++){if(i==todayyear)
5、{outstr=outstr+''+i+'年';}else{outstr=outstr+''+i+'年';}}outstr=outstr+'';//月份outstr=outstr+'6、,''+selmonthname+'',''+seldayname+'')">';vartodaymonth=today.getMonth()+1;for(i=1;i<=12;i++){if(i==todaymonth){outstr=outstr+''+FnFormatLessTen(i)+'月';}else{outstr=outstr+'7、)+'">'+FnFormatLessTen(i)+'月';}}outstr=outstr+'';//日期outstr+='';vartodayday=today.getDate();varnewdate=newDate(todayyear,todaymonth);vardatenum=newdate.getUTCDate();for(i=1;i<=datenum;i++){if(i==todayday){outstr8、=outstr+'
6、,''+selmonthname+'',''+seldayname+'')">';vartodaymonth=today.getMonth()+1;for(i=1;i<=12;i++){if(i==todaymonth){outstr=outstr+''+FnFormatLessTen(i)+'月';}else{outstr=outstr+'7、)+'">'+FnFormatLessTen(i)+'月';}}outstr=outstr+'';//日期outstr+='';vartodayday=today.getDate();varnewdate=newDate(todayyear,todaymonth);vardatenum=newdate.getUTCDate();for(i=1;i<=datenum;i++){if(i==todayday){outstr8、=outstr+'
7、)+'">'+FnFormatLessTen(i)+'月';}}outstr=outstr+'';//日期outstr+='';vartodayday=today.getDate();varnewdate=newDate(todayyear,todaymonth);vardatenum=newdate.getUTCDate();for(i=1;i<=datenum;i++){if(i==todayday){outstr
8、=outstr+'
此文档下载收益归作者所有