I am using this plugin for selecting date range, The configuration is my js is as follows:
// date range picker
$('.date_input').daterangepicker({
autoUpdateInput: false,
locale: {
cancelLabel: 'Clear',
format: 'DD-MM-YY'
}
});
I need to disable the future dates, i tried using maxDate, but it did not work. Please help me to resolve this issue.Help would be much appreciated Thanks!!
In the calendar widget their is an option to select max date, in which you can set the value as CurrDate(). So that future dates in the calendar would be disabled.
daterangepicker({ autoUpdateInput: false, locale: { cancelLabel: 'Clear', format: 'DD-MM-YY' } });
If you want to future date disable from today use today. getFullYear() - 10 in order to disable 10 years before which means disable from 2008.
You can use maxDate
options
(Date object, moment object or string) The latest date a user may select
$('.date_input').daterangepicker({
maxDate: new Date()
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With