I am using the eonasdan bootstrap 3 datepicker (v4.14.30).
I try to read e.date value on dp.show and I get undefined.
Has anyone had a similar problem?
Here is a jsfiddle of the issue.
https://jsfiddle.net/adollphus/c79ddtok/
Thanks for your time.
Html
<div class="input-group date" style="max-width: 300px; float:left;">
<input class="form-control model-edit-info input-sm"
id="datepicker"
type="text" />
<span class="input-group-addon input-sm" style="cursor:pointer">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
Jquery
$(document).ready(function () {
var datepicker = $('#datepicker').parent();
datepicker.datetimepicker({
locale: 'pl',
format: 'YYYY-MM-DD',
minDate: new Date(1900, 0, 1),
showTodayButton: true,
toolbarPlacement: 'top',
widgetPositioning: {
horizontal: 'right'
}
});
datepicker.on('dp.show', function (e) {
alert('e.date=' + e.date);
});
});
replace dp.show
with dp.change
datepicker.on('dp.show', function(e) {
alert('e.date=' + e.date);
});
with
datepicker.on('dp.change', function(e) {
alert('e.date=' + e.date);
});
here's the updated JSFiddle