http://bootstrap-datepicker.readthedocs.io/en/latest/markup.htmlブートストラップ日付ピッカーは、選択した日
私がtrueに設定されてmultidateインライン日付ピッカーを持っているため、すべての日付を返しmultidate。私は、動作するカレンダーで1日以上を選択する必要があります。ボタンから選択した日付を返すにはどうすればよいですか?指示に従ってgetDatesは日付の配列を返しません???
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" rel="stylesheet"/>
<div class="datepicker" data-date-format="mm/dd/yyyy"></div>
<button type="button" class="btn btn-primary btn_save">Save</button>
<script>
$(document).ready(function() {
$('.datepicker').datepicker({
format: 'mm/dd/yyyy',
multidate: true,
daysOfWeekDisabled: [0, 6],
clearBtn: true,
todayHighlight: true,
daysOfWeekHighlighted: [1, 2, 3, 4, 5]
});
$('.datepicker').on("changeDate", function() {
var the_dates = $('.datepicker').datepicker('getDates');
//this does not work
console.log(the_dates)
});
$(document).on('click', ".btn_save", function (e) {
var the_dates = $('.datepicker').datepicker('getDates');
//this does not work
console.log(the_dates)
});
});
</script>
ない答えが、そのプロジェクトは少し大ざっぱに見えます。彼らは[公開された465の問題](https://github.com/uxsolutions/bootstrap-datepicker/issues)と[64オープンプルリクエスト](https://github.com/uxsolutions/bootstrap-datepicker/pulls)このサイズのプロジェクトではたくさんのようです... –
私は日を選択できるブートストラップ日付ピッカーが必要ですが、これは私が見つけることができる唯一のものでした。 Jqueryを見つけましたが、私のプロジェクト全体がブートストラップであるとスタイリングの問題です。 – Rob