wangzuo / input-moment

React datetime picker powered by momentjs
https://wangzuo.github.io/input-moment
ISC License
527 stars 173 forks source link

Doesn't select previously chosen date on load #87

Open stocks09 opened 6 years ago

stocks09 commented 6 years ago

Hi, When my input-moment calendar loads saved data to show previously selected date, it always selects the current date and not what I saved before.

In my FormComponent:

 <Field
                name="starts"
                value={eventStarts} 
                component={DateTimePicker}   
                withRef
              />

In my DateTimePicker:

render() {
    return (
          <InputMoment
            moment={this.state.m}
            onChange={this.handleChange}
            minStep={5} 
          /> 
    );

NOTE: It properly saves data in the datastore so I know it works this part. The part that doesn't work is re-selecting the last chosen date.