ブートストラップのdatepickerを使用し、選択した日付をknockoutjsでバインドしたいと考えています。knockoutjsでブートストラップの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());
}
});
は、私が使用したいが、そうすることについては移動する方法がわからないフィドルです。 http://jsfiddle.net/zNbUT/276/
私のために完璧に動作しますが、この問題に対する別の解決策を見つけました。 http://stackoverflow.com/questions/14782728/object-object-object-has-no-method-when-using-bootstrap-datepicker – Gericke