Because a training management module has been done, there is a start and end training time. Time and date if a user enters it manually, even if you request a time format, the user may still be in the wrong time format. So think about it, or find a JS calendar plugin. Let me introduce my own experience.
The first step. Download it first. Address: Http://www.my97.net/dp/down/My97DatePickerBeta.zip
Download it and you will see a demo page and a JS folder. In the demonstration page, the explanation is very clear, this is very grateful to the predecessors AH. From the page introduction is not difficult to find that the calendar plugin has been updated, fixed some bugs, also recommended to use the latest version, at this time I am using the latest version.
The Demo page explains a lot, but we're just going to use the 12th line of code. As follows:
<script language= "javascript" type= "Text/javascript" src= "My97datepicker/wdatepicker.js" ></script>
<input class= "Wdate" type= "text" onclick= "Wdatepicker ()" >
Put the code where you need the calendar. Notice that you modify the JS pointer to the path, and modify it to your own. JS folder "My97datepicker" If you feel long can be modified, but do not modify the file name in the folder.
The second step. Modify as needed.
The Downloaded Demo page date is a date that does not contain time and seconds, and if necessary, it can be modified by configuration. Such as:
<script language= "javascript" type= "Text/javascript" src= "__public__/calendar/wdatepicker.js" ></script >
<input class= "Wdate" type= "text" onclick= "Wdatepicker ({startdate: '%y-%m-01 00:00:00 ', datefmt: ' Yyyy-MM-dd HH: Mm:ss ', alwaysusestartdate:true}) ">
Add a red flag to show the time format of the Yyyy-mm-dd HH:mm:ss. For further details, refer to:
Http://www.my97.net/dp/demo/index.htm
The third step. Eliminate the need for files to slim down.
The "My97datepicker" folder contains also multiple languages, as well as skin settings. If I don't need this, then I can get rid of it. I removed the Lang language Pack and the development package. Skins are skin style package, originally was removed, and later felt not good-looking, plus. Well, the JS calendar plugin is finished.