How to set default value in Calendar

UI Components for React
Post Reply
mpprime
Posts: 1
Joined: 10 Apr 2016, 17:47

17 Jun 2020, 15:54

Hi.
I'm trying to put the default day into a Calendar component.
at the moment I set it fixed in the state:

Code: Select all

    this.state = {
            start: '18/06/2020'
        };
        
        
        <Calendar id="data_inizio" showIcon={true} value={this.state.start} required
                                          onChange={(e) => this.setState({start: e.value, minDate: e.value})}
                                          dateFormat="dd/mm/yy" monthNavigator={true} yearNavigator={true}
                                          yearRange="2020:2030" touchUI={true}/>
but the Calendar is always empty.

mert.sincan
Posts: 4345
Joined: 29 Jun 2013, 12:38

11 Oct 2020, 01:07

Hi,

Sorry for the delayed response! Could you please try to add it as a Date object to value property?

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests