How do I clear/reset the selected dates on the jQuery UI Datepicker calendar?

I was trying to accomplish this very thing, that is, empty the datepicker so that filters entered by the user could be removed. Googling a bit I found this sweet piece of code: You can add the clear feature even on read only fields. Just add the following code to your datepicker: }).keyup(function(e) { if(e.keyCode … Read more

jQuery-UI datepicker default date

Try passing in a Date object instead. I can’t see why it doesn’t work in the format you have entered: <script type=”text/javascript”> $(function() { $(“#birthdate” ).datepicker({ changeMonth: true, changeYear: true, yearRange: ‘1920:2010’, dateFormat : ‘dd-mm-yy’, defaultDate: new Date(1985, 00, 01) }); }); </script> Datepicker Widget Specify either an actual date via a Date object or … Read more

Setting min date in jQuery datepicker

$(function () { $(‘#datepicker’).datepicker({ dateFormat: ‘yy-mm-dd’, showButtonPanel: true, changeMonth: true, changeYear: true, yearRange: ‘1999:2012’, showOn: “button”, buttonImage: “images/calendar.gif”, buttonImageOnly: true, minDate: new Date(1999, 10 – 1, 25), maxDate: ‘+30Y’, inline: true }); }); Just added year range option. It should solve the problem

jQuery UI Datepicker onchange event issue

You can use the datepicker’s onSelect event. $(“.date”).datepicker({ onSelect: function(dateText) { console.log(“Selected date: ” + dateText + “; input’s current value: ” + this.value); } }); Live example: $(“.date”) .datepicker({ onSelect: function(dateText) { console.log(“Selected date: ” + dateText + “; input’s current value: ” + this.value); } }) .on(“change”, function() { console.log(“Got change event from … Read more

How do I localize the jQuery UI Datepicker?

For those that still have problems, you have to download the language file your want from here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n and then include it in your page like this for example(italian language): <script type=”text/javascript” src=”https://stackoverflow.com/scripts/jquery.ui.datepicker-it.js”></script> then use zilverdistel’s code 😀