:
You can also display the text box when it gets focus, and modify it slightly: 1: <!--text box get focus display calendar needs to import JS file--
2: <script src="Js/custom.min.js"></script>
Modify the div section as follows: 1: date selection: <input type=' text ' id=' datepicker '/>
other unchanged, refresh the browser, effect
This is obviously not quite in line with our habits, we need to modify JS to make it conform to our usage habits 1: <script type="Text/javascript">
2: "#datepicker" ). DatePicker
3: {
4: showmonthafteryear:true//year in front, month in the rear
5: yearsuffix:"Year", //Add suffix year
6: prevtext:"Last month", //mouse placed on the button to display the text
7: nexttext:"next month",
8: monthnames:["January","February","March","April","May","June" "," July "," August "," September "," October "," November"," December ",], //Display month in Chinese
9: //Show weekly in Chinese (must be in this order, otherwise the date is wrong)
Ten: daynamesmin:["Day","One", "two","three","Four","five" ,"Six"
11:
dateformat:"Yy-mm-dd",
: });
: </script>
the modified effectfor text boxes, the default is to show the date when the focus is taken, or you can add a button later 1: showon:"button", //Add Selection button after text box
You can add a picture to the button or modify the text to beautify the button
1: buttontext:"Date", //Set the selection button to the text
2: buttonimage:"Css/images/animated-overlay.gif", //Set Picture for button
If you want to display only pictures, you can add the following code
1://Boolean, whether to display the picture as a button, false to show the form of the button, true to display the picture individually, false by default
2: buttonimageonly:true
You can also freely select the month and year
1: changeyear:true, //Boolean value, whether the year can be selected
2: changemonth:true,//Boolean, whether the month can be selected
Effect
Don't like English? OK, let's replace the numbers.
1:The abbreviation of the month when//changemonth is true
2: monthnamesshort:["to","to","to","to","to", "a","" ","",""," "Ten", "one","12" ],
Look at the effect
You can also set the selected year range
1://When Changeyear is true, sets the year range, C represents the current year, plus minus 10 indicates that the current year is pushed back by 10 and 10 years before the push
2:"c-10:c+10"
Of course, you can also add panels
1: showbuttonpanel:true, //Whether the panel is displayed
For children who do not like English, you can change to Chinese
1://The text of the current day is returned on the settings panel, only showbuttonpanel:true will be displayed
2: currenttext:"Today",
3: //Set the text on the panel to be closed, only showbuttonpanel:true will show
4: "Off",
These are also what we often use, if you need any function, you can modify JS. I have packaged the above code with the DatePicker from the UI and can apply it directly to your project. If you need it, you can download it from the link given below:
Fork Git: Https://github.com/dwqs/datepicker
CSDN: http://download.csdn.net/detail/u011043843/7809973
Baidu Cloud: Http://pan.baidu.com/disk/home#path=%252Fthemes
How to use the DatePicker plugin for Jquery UI