How to Use the WdatePicker calendar control and the wdatepicker calendar Control
I. Specific usage can refer to the official documentation: http://www.my97.net/dp/demo/resource/main.asp
Ii. Examples at work:
1. After the date is selected, the time is automatically filled with the current time
Code:
<Input class = "texts one Wdate" id = "StartTime_date" name = "StartTime_date" value = "$ {task. startTime_date} "onclick =" WdatePicker ({dateFmt: 'yyyy-MM-dd', isShowClear: true, readOnly: true, maxDate: '# F {$ dp. $ D (\ 'stoptime _ date \ ')}', onpicked: pickedFunc}) "/> <script> function pickedFunc () {var updateFlag = $. trim ($ ("input [name = 'updateflag']"). val (); // if ($ dp. cal. currFocus. id = "StartTime_date") {$ dp. $ ('starttime _ date '). value = $ dp. cal. getP ('y') + "-" + $ dp. cal. getP ('M') + "-" + $ dp. cal. getP ('D'); if (updateFlag = "false") {// linkage is performed only when the add operation is performed, and the time is automatically filled with the current time $ dp. $ ('starttime _ hour '). value = $ dp. cal. date. h; $ dp. $ ('starttime _ second '). value = $ dp. cal. date. m ;}}</script>
2. Select a time period and select multiple time periods at a time.
Implementation Method: Create a hidden input, and add the value to the input box to be displayed each time.
<Td class = "t"> specific time period: </td> <input id = "Run_times" class = "texts" name = "Run_times" value = "$ {task. run_times} "onclick =" $ ('# wdateimg '). click (); "/> <input id =" tempTime "type =" hidden "/> <span class =" t "style =" padding-top: 5px "> </span> <span class =" Type "> & nbsp; </span> <span class = "Notes"> Time Interval separated by commas </span> </td> <script> function pickedFunc () {if ($ dp. cal. currFocus. id = "tempTime") {$ dp. $ ('run _ times '). value + = $ dp. $ ('temptime '). value + ";" ;}}</script>