I'm using this jQuery inline datePicker plugin sample but I don't know how to set up default date selected. Do you have any idea?
$('.date-pick').datePicker({
defaultDate: $.datepicker.parseDate("d m y", "31 8 2009")
})
You will need to use the dpSetSelected
method . I've added that into the code from the example page below:
$(function()
{
$('.turn-me-into-datepicker')
.datePicker({inline:true})
.dpSetSelected('01/04/2010') // The string should be in Date.format
.bind(
'dateSelected',
function(e, selectedDate, $td)
{
console.log('You selected ' + selectedDate);
}
);
});
As mentioned, if you have changed Date.format then you will need to ensure that the string is in the format you changed it to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With