How to jQuery date picker
posted on: 2010-04-16 18:36:14
The date picker jQuery class is by far one of the simplest and most impressive classes to implement. From one time or another one of your clients will ask you to implement a date picker. It's one of the most commonly used and oldest widgets on the net. There are literally tonnes and tonnes of custom calendar javascript classes that have been made over the years, some free and some even require you to part with your hardly earned cash.
Date: - see for yourself.
The jQuery date picker is by far the simplest and best I have used thus far, and best of all it just binds onto a simple input field, uses the least code and it's free.
<script type="text/javascript" src="http://someplace/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
$("#datepicker_basic").datepicker();
$('#datepicker_basic').datepicker('option', {dateFormat: 'yy-mm-dd'});
});
</script>
<input type="text" id="datepicker_basic">
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="http://someplace/js/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
$("#datepicker_basic").datepicker();
$('#datepicker_basic').datepicker('option', {dateFormat: 'yy-mm-dd'});
});
</script>
<input type="text" id="datepicker_basic">
