My97DatePicker
My97DatePicker
1、下载My97DatePicker组件包 下载地址:http://download.csdn.net/detail/emoven/8249073 <!DOCTYPE html> <html> <head> <title>My97DatePicker日期控件使用</title> </head> <body> <center> <h2>My97DatePicker日期控件的使用</h2> </center> 基本用法: <input id="date1" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" /> <br> <br> 只能选择今天以前的日期: <input id="Text1" class="Wdate" onfocus="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'})" /><br> <br> 使用运算表达式 只能选择 20小时前 至 30小时后 的日期 <input id="Text2" class="Wdate" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm', minDate: '%y-%M-%d {%H-20}:%m:%s', maxDate: '%y-%M-%d {%H+30}:%m:%s' })" /><br> <br> 开始,结束日期:<!-- $dp.$ 相当于 document.getElementById 函数. --> <input id="sdate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'edate\')}'})" /> - <input id="edate" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'sdate\')}',startDate:'#F{$dp.$D(\'sdate\',{d:+1})}'})" /><br> <br> <input type="button" value="点我" id="clickme" /> </body> <script src="Scripts/jquery-3.3.1.js"></script> <script src="Scripts/My97DatePicker/WdatePicker.js"></script> <script> $(function () { $("#clickme").click(function () { alert($("#date1").val()); }) var datetime = "2018-09-15"; $("#Text1").val(datetime); }) </script> </html>