When I click the button I want to console.log
the date and time that gets inserted in the input, but when I try I only get 'undefined'.
$('#picker-start').datetimepicker({
timepicker: true,
datepicker: true,
format: 'y-m-d H:i',
onShow: function(ct) {
this.setOptions({
maxDate: $('#picker-end').val() ? $('#picker-end').val() : false
})
}
})
$('#picker-end').datetimepicker({
timepicker: true,
datepicker: true,
format: 'y-m-d H:i',
onShow: function(ct) {
this.setOptions({
minDate: $('#picker-start').val() ? $('#picker-start').val() : false
})
}
});
<div class="form-group">
<label for="">Start Date</label>
<input type="text" id="picker-start" class="form-control">
<label for="">Due Date</label>
<input type="text" id="picker-end" class="form-control">
<button type="submit" id="btn-time">get date</button>
</div>