reactjsdatepickerreact-datepickerreact-dates

How to show a single calendar in react-dates?


I need to integrate SingleDatePicker from react-dates.

This is what I have written in the code

<SingleDatePicker
    date={moment()} 
    onDateChange={date => this.setState({ date })} 
    focused={this.state.focused}
    onFocusChange={({ focused }) => this.setState({ focused })}
    id="your_unique_id"
/>

Now it shows me double calendar.

enter image description here

But I need to show only single. Something like this

enter image description here

Is there any option in the SingleDatePicker to do this?


Solution

  • you can try this:

    <SingleDatePicker
        date={moment()} 
        onDateChange={(date) => this.setState({ date })}
        numberOfMonths={1},
        focused={this.state.focused}
        onFocusChange={({ focused }) => this.setState({ focused })}
        id="your_unique_id"
    />