longbill/jquery-date-range-picker

Default month is being set to one month behind if using endDate=current date

Closed this issue · 1 comments

The current month show February instead of March when calendar is opened/clicked.
It should be default to current month. If enddate param is not supplied then it works fine.
I don't see any option to force it to initiate to current month.

$('#joining_date').dateRangePicker(
        {
            autoClose: true,
            singleDate : true,
            showShortcuts: false,
            singleMonth: true,

            format: 'YYYY-MM-DD',
            startOfWeek: 'monday',
            endDate: moment().format('YYYY-MM-DD')
        });
mtx-z commented

Same issue.

EDIT:

fixed with

 .bind('datepicker-open', function (event, obj) {
        $('dom_el')data('dateRangePicker').resetMonthsView(moment());
      });