longbill / jquery-date-range-picker

A jQuery plugin that allows user to select a date range
MIT License
1.12k stars 579 forks source link

Cannot read property 'find' of undefined #413

Open ehdwns980416 opened 6 years ago

ehdwns980416 commented 6 years ago

I got this message.

ERROR TypeError: Cannot read property 'find' of undefined

This is my options.

let tempDate = moment().format('YYYY-MM-DD');
$('.datepicker').dateRangePicker({
    format: 'YYYY-MM-DD',
    monthSelect: true,
    yearSelect: true,
    selectForward: true,
    batchMode: 'week-range',
    showShortcuts: false,
    language: 'ko',
    separator: ' λΆ€ν„° ',
    inline:true,
    container: '#dailyDatePicker',
    alwaysOpen:true,
    singleMonth: true,
    singleDate : true,
    startDate: moment(tempDate).subtract(1, 'months').format('YYYY-MM-15'),
    endDate: moment(tempDate).add(1, 'months').format('YYYY-MM-15'),
})

When I debugged, I found month monthSelect function caused this problem when I use singleMonth and singleDate options. check please πŸ™

holtkamp commented 6 years ago

Can you provide a working example of this problem? For example using https://jsfiddle.net, this makes it easier to understand the problem and come up with a solution. No active maintenance is provided in this library currently, so we depend on the community...