Bootstrap datetimepicker default date overridden by max date
Using an example of MinDate or MaxDate and DefaultDate .... <script type="text/javascript">
$(function () {
$('#enddatepicker').datetimepicker({
minDate: moment().add(1, 'd').toDate(),
defaultDate: moment().add(1, 'M').toDate(),
format: 'DD.MM.YYYY'
});
});
</script>
Looking at the code on GitHub (line 1674) if you set the option useCurrent to false, your default may not be overridden:
<script type="text/javascript">
$(function () {
$('#enddatepicker').datetimepicker({
useCurrent: false,
minDate: moment().add(1, 'd').toDate(),
defaultDate: moment().add(1, 'M').toDate(),
format: 'DD.MM.YYYY'
});
});
</script>
Comments
Post a Comment