This project provided a easy-used datepicker plugin.
- Import the
bupt.datepicker.css
andbupt.datepicker.js
into your page.
<link type="text/css" rel="stylesheet" href="./bupt.datepicker.css" />
<script type="text/javascript" src="bupt.datepicker.js"></script>
- Use the datepicker like follow.
<input type="text" id="inputID" />
<script type="text/javascript">
datepicker.init('inputID');
</script>
- Suggest add some style to
<input>
to show better , just like:
<input type="text" id="inputText" class="datepicker-input">
<style>
.datepicker-input{
border:1px solid #ccc;
border-radius: 4px;
padding: 5px;
height: 24px;
line-height: 24px;
width:230px;
}
</style>
example.html
provided an complete example of this datapicker plugin.