Skip to content

How to get selected date #17

@pkassonss

Description

@pkassonss

Just started using this, works great !

But, i do not have a state object 'date' and the examples are show that (this.state.date).

Ok, it works, but when I try to use it / format it, system says it can't find it :can't find variable date.

What is best practice to use it as a component:

       <Calendar style={styles.calendar} onChange={(date) => this.setState({date})} selected={this.state.date}
       minDate={moment().startOf('day')}
       maxDate={moment().add(10, 'years').startOf('day')}
       />

All good, but again, this.state.date not defined ... if I use something else, it crashes render saying invalid date format.

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions