0
      <DayPickerSingleDateController
        numberOfMonths={1}
        keepOpenOnDateSelect={true}
        dayPickerNavigationInlineStyles={{ color: 'red' }}
        onDateChange={handleSinglePickerDateChange}
        focused={false}            
        date={moment(clickedDate)}
        onFocusChange={(focusedInput) => {
          console.log('focus change of DayPickerSingleDateController');
        }}
        initialVisibleMonth={() => moment(new Date('01-08-2023'))}
        isDayBlocked={getBlockedDay}
        isDayHighlighted={getHighlightedDay}
      />

In above, I'm trying to set initialVisible month of calendar to september. Is there any syntax error I'm doing here or something is buggy here?

Please help if anyone know the correct way.

1 Answers1

0

Yes, there's syntax error, change the line from initialVisibleMonth={() => moment(new Date('01-08-2023'))} to initialVisibleMonth={ moment(new Date('01-08-2023')}

Kiran Kumar
  • 1,033
  • 7
  • 20