PROBLEM SOLVED:
jsFiddle: http://jsfiddle.net/s4d0fxd2/1/
As the picture above show, I am trying to alert the dates selected from bootstrap datepicker, but I can't get it to show the format I want(format: YYYY-mm-dd)
HTML:
<div class="datepicker" id="datepicker1" ></div>
JS:
$('.datepicker').datepicker({
format: 'yyyy-mm-dd',
multidate: true,
multidateSeparator: ",",
calendarWeeks: true,
todayHighlight: true
}).on('changeDate', function(e){
alert($('#datepicker1').datepicker('getDates'));
});
Though I get the proper format when using <input>
and show the calendar when input is focused instead of inline
calendar, but that is not an option.
Docs for bootstrap-datepicker: http://bootstrap-datepicker.readthedocs.org/en/release/
jsFiddle: http://jsfiddle.net/s4d0fxd2/