I'm using this nifty little date and time picker [ http://trentrichardson.com/examples/timepicker/ ]. How can I set the date and time for when the picker opens?
If you're using this on a form, set it from a hidden input.
$(document).ready(function () {
$("#Date").datetimepicker({
ampm: true
});
var date = new Date(
Date.parse(
$('#DatePicker').val(),
"mm/dd/yyyy hh:MM tt"
)
);
$('#Date').datetimepicker('setDate', date);
});
HTML Form:
<input type="hidden" id="DatePicker" />
<input type="text" id="DatePicker" value="fromyourdatabase" />