I assume that you are using this plugin from the code you provided in the code snippet. Assuming this is a plugin that you are trying to use in your application, you are mistaken in order to update start and end dates, or possibly mix things from different libraries.
In any case, if I understand your problem correctly, this is jsfiddle , which performs one part of your functions.
When updating a new start or end date, the syntax to be used is as follows (from the plugin docs):
$('#datetimepicker').datetimepicker('setStartDate', '2012-01-01');
and the name parameters for start and end dates are setStartDate and setEndDate not minDate and MaxDate also the function that is used to update them is datetimepicker not datepicker.
Here is the code from JS Fiddle:
$(document).ready(function(){ $("#form_datepicker_startdate").datetimepicker({ format: "yyyy-mm-dd", weekStart: 1, todayBtn: 1, autoclose: 1, todayHighlight: 1, startView: 2, minView: 2, startDate : new Date('2012-08-08'), endDate : new Date('2014-08-08'), }).on('changeDate', function (selected) { var minDate = new Date(selected.date.valueOf()); $('#form_datepicker_enddate').datetimepicker('setStartDate', minDate); }); $("#form_datepicker_enddate").datetimepicker(); });
Hope this helps, let me know if I am mistaken in my assumptions anywhere.
source share