Tempus-dominus: Setting maxDate makes it the defaultDate

Created on 8 Oct 2015  路  2Comments  路  Source: Eonasdan/tempus-dominus

Setting the maxDate option makes the textbox display the specified date which I believe should be the behavior of defaultDate?
$('#datepicker').datetimepicker({
format: 'MMMM D, YYYY',
maxDate: moment().subtract(18, 'y')
});
But if I remove the maxDate option, it behaves as normal - no date in the textbox.

Most helpful comment

ok solved. Set useCurrent:false

$('#datepicker').datetimepicker({
format: 'MMMM D, YYYY',
maxDate: moment().subtract(18, 'y'),
useCurrent: false
});

All 2 comments

I'm having the same issue.

ok solved. Set useCurrent:false

$('#datepicker').datetimepicker({
format: 'MMMM D, YYYY',
maxDate: moment().subtract(18, 'y'),
useCurrent: false
});

Was this page helpful?
0 / 5 - 0 ratings