React-big-calendar: date[("get" + method)] is not a function error

Created on 6 Sep 2018  路  2Comments  路  Source: jquense/react-big-calendar

Hello,i have a error
date[("get" + method)] is not a function error

class MyWeek extends React.Component {
    render() {
        let { date } = this.props
        let range = MyWeek.range(date, this.props)
        return <TimeGrid {...this.props} range={range} eventOffset={15} />
    }
}

MyWeek.range = (date, days) => {
    let start = date
    let end = dates.add(start, days.datePickerDays.length - 1, 'day')

    let current = start
    let range = []

    while (dates.lte(current, end, 'day')) {
        range.push(current)
        current = dates.add(current, 1, 'day')
    }
    return range
}

MyWeek.navigate = (date, action) => {
    switch (action) {
        case BigCalendar.Navigate.PREVIOUS:
            return dates.add(date, -1, 'day')

        case BigCalendar.Navigate.NEXT:
            return dates.add(date, 1, 'day')

        default:
            return date
    }
}

If i add more 1 days in my array
days.datePickerDays
its show me error

Most helpful comment

Please use the issue template, and provide a runnable repro of the issue otherwise we are just gonna guess at what might be wrong. This sounds like you aren't using date objects for your events

All 2 comments

Please use the issue template, and provide a runnable repro of the issue otherwise we are just gonna guess at what might be wrong. This sounds like you aren't using date objects for your events

I'm sorry @ZhoraKhachatryanArmweb, did you solve this error?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Beyazatli picture Beyazatli  路  3Comments

dogC76 picture dogC76  路  4Comments

gsavvid picture gsavvid  路  3Comments

manutenfruits picture manutenfruits  路  3Comments

tiaaaa123 picture tiaaaa123  路  4Comments