First: You need to introduce jquery-1.10.2.js (version unlimited) and laydate.js files; jquery references must be in front of you, otherwise you won't get the results you want.
And then:
Code
<ID= "Start" runat= "Server"></asp: TextBox><ID= "End" runat= "Server" ></asp:textbox>
2) JS code
<script type= "Text/javascript" > $(function () { varStart ={elem:' #start ',//Select input with ID startFormat: ' Yyyy/mm/dd hh:mm:ss ',//Auto-generated time formatMin:laydate.now (),//set the minimum date to the current dateMax: ' 2099-06-16 23:59:59 ',//Maximum DateIstime:true,//time must be filled inIstodayfalse,//whether it is the same dayStart:laydate.now (0, "Yyyy/mm/dd hh:mm:ss"),//set the start time to the current timeChoosefunction(datas) {end.min= Datas;//The minimum date to reset the end date after the start date is selected .End.start = Datas//set the initial value of the end date to the start date } }; varEnd ={elem:' #end ', Format:' Yyyy/mm/dd hh:mm:ss ', Min:laydate.now (), Max:' 2099-06-16 23:59:59 ', Istime:true, Istoday:false, Start:laydate.now (0, "Yyyy/mm/dd hh:mm:ss"), choose:function(datas) {Start.max= Datas;//when the end date is selected, the maximum date to reset the start day } }; Laydate (start); Laydate (end); }) </script>
The final display is:
Use of laydate and limit the size of two text boxes