tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 108 forks source link

minDate #26

Closed rajgaurav1 closed 9 years ago

rajgaurav1 commented 9 years ago

I want to set the Min date and dates before that should be disabled. I tried datepickerOptions: { minDate: '2015-07-01', maxDate: 'Today' }

'Today' is working but minDate is not working

op16 commented 9 years ago

The datepicker option minDate is supposed to be in the format defined by the dateFormat option, which by default is "mm/dd/yy".

So, minDate: '07/01/2015' works fine, but you might want to include in datepickerOptions dateFormat: 'yy-mm-dd' and keep minDate as given. (see http://api.jqueryui.com/datepicker/#utility-formatDate)

rajgaurav1 commented 9 years ago

i've tried multiple options both in jquery.comiseo.daterangepicker.js file where i changed the date format and the datepickerOptions is tried above... none synced

op16 commented 9 years ago

Both solutions work for me:

javascript $("#e1").daterangepicker({ datepickerOptions : { dateFormat: 'yy-mm-dd', minDate: '2015-07-01', maxDate: 'Today' } });


``` javascript```
$("#e2").daterangepicker({
    datepickerOptions : {
        minDate: '07/01/2015',
        maxDate: 'Today'
    }
});
rajgaurav1 commented 9 years ago

thanks a ton.. the first one worked perfectly... very few respond so quick n prompt!!! thanks a lot again!!!!