本文演示如何在MyEclipse项目中使用My97DatePicker日期控件
1、下载My97DatePicker日期控件, My97DatePicker日期控件下载地址
2、在MyEclipse项目中安装My97DatePicker,把下载后的My97DatePicker解压后放在WebRoot子目录下,如WebRoot/dd/js/My97DatePicker(我把My97DatePicker放在WebRoot/dd/js/目录下,My97DatePicker为解压后的文件夹)
3、引用My97DatePicker,在要使用的jsp页面中引入js,如下
<script type="text/javascript" src="<%=request.getContextPath() %>/dd/js/My97DatePicker/WdatePicker.js"></script>
4、调用My97DatePicker,如下
//格式:2012-09-12 <input id="endDate" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" /> //格式:2012-09-12 12:23:22 <input id="endDate" readonly="readonly" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" />
<input class="Wdate" type="text" id="pageEndTime" style=" 150px;" onFocus="WdatePicker({isShowClear:true,readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" />