I'm using datetimepicker with bootstrap.
Everything went good, then I tried to use the 2 date time picker to select a date interval, but when trying to select a date i'm getting in the console
TypeError: $('#datetimepicker2').data("DateTimePicker").maxDate is not a function. (In '$('#datetimepicker2').data("DateTimePicker").maxDate(e.date)', '$('#datetimepicker2').data("DateTimePicker").maxDate' is undefined)
I'm using bootstrap-datetimepicker from https://eonasdan.github.io/bootstrap-datetimepicker/
(some error occurs also with maxDate)
This is the script i'm calling
$(function() {
$('#datetimepicker2').datetimepicker({
locale : 'it',
format : 'DD/MM/YYYY HH:mm'
});
$('#datetimepicker3').datetimepicker({
locale : 'it',
format : 'DD/MM/YYYY HH:mm',
useCurrent: false //Important! See issue #1075
});
$("#datetimepicker2").on("dp.change", function (e) {
$('#datetimepicker3').data("DateTimePicker").minDate(e.date);
});
$("#datetimepicker3").on("dp.change", function (e) {
$('#datetimepicker2').data("DateTimePicker").maxDate(e.date);
});
});
Am I missing something?
$('#datetimepicker2').data("DateTimePicker").maxDate(e.date);Have you got this line of code from any source?? - Guruprasad J Rao$('#datetimepicker2').datetimepicker('maxDate',e.Date)- Guruprasad J RaoYour solution works in fact.. Can you show yourhtml- Guruprasad J Rao