2

I am using react-day-picker. By default, it shows system date as the highlighted date. I want to use the date received from the server and make it highlighted date.

Here's my code :-

    <DayPickerInput 
onDayChange={this.handleDayChange.bind(this, 'maximumDeliveryDate')}
                                        format="DD/MM/YYYY"
                                        formatDate={formatDate}
                                        placeholder="DD/MM/YYYY"
                                        value={this.state.maximumDeliveryDate}
                                        inputProps={{readOnly: 'readOnly'}}
                                        dayPickerProps={{
                                            selectedDays: this.state.selectedDay,
                                            disabledDays: {before: new Date()}
                                      }}/>

Has anyone done something like this?

Shivam Kumar
  • 121
  • 2
  • 8
  • "it shows system date as the highlighted date" --> it displays the today date as highlighted, but you can easily update the CSS and disable that. – gpbl Mar 01 '18 at 16:16
  • yes @gpbl did that only. I disabled the highlighted day CSS. But, I think there should be a prop which can be passed to set the start date of the calendar. Thanks – Shivam Kumar Mar 06 '18 at 20:07
  • Yeah there’s no “start date”. in day picker. Only “today” which represent today :) – gpbl Mar 07 '18 at 15:31

0 Answers0