Php – Jquery UI : date picker. How to set date in date picker by $_GET

datepickerjqueryjquery-uiPHP

I can't find how I can set $_GET variables to set manually the date in the date picker.
http://jqueryui.com/demos/datepicker/

( example : http://www.something.com/?day=21&month=2&year=2010 )

Is that possible ?

Thanks

Best Answer

Use the gup function in this link to read the get parameters. Then call the setDate method (error handling omitted):

$(function() {

  $("#Datepicker").datepicker();
  var year = gup("year");
  var day = gup("day");
  var month = gup("month");

  $("#Datepicker").datepicker("setDate", month + "/" + day + "/" + year);

});