.datepicker('setdate') issues, in jQuery

后端 未结 6 898
轻奢々
轻奢々 2020-12-06 04:11

I have a function that executes a query to get some data based on a certain date range which is selected using .datepicker(). I am trying to set the datepicker\'s that are

6条回答
  •  没有蜡笔的小新
    2020-12-06 04:34

    As Scobal's post implies, the datepicker is looking for a Date object - not just a string! So, to modify your example code to do what you want:

    var queryDate = new Date('2009/11/01'); // Dashes won't work
    $('#datePicker').datepicker('setDate', queryDate);
    

提交回复
热议问题