Chcę użyć datepicker bootstrap i powiązać wybraną datę z knockoutjs.Powiąż datepicker datepicker z knockoutjs
funkcja, która używa datepicker:
$(function() {
// create the departure date
$('#depart-date').datepicker({
autoclose: true,
format: 'yyyy/mm/dd',
}).on('changeDate', function(ev) {
ConfigureReturnDate();
});
$('#return-date').datepicker({
autoclose: true,
format: 'yyyy/mm/dd',
startDate: $('#depart-date').val()
});
// Set the min date on page load
ConfigureReturnDate();
// Resets the min date of the return date
function ConfigureReturnDate() {
$('#return-date').datepicker('setStartDate', $('#depart-date').val());
}
});
Oto skrzypce że chcę używać, ale nie jest pewien, jak się za to zabrać. http://jsfiddle.net/zNbUT/276/
znaleziono inne rozwiązanie tego problemu. http://stackoverflow.com/questions/14782728/object-object-object-has-no-method-when-using-bootstrap-datepicker – Gericke