We have the above implementation of datepicker within a report form. The (this.state.datetime) state is linked to a redux state. The initial state (this.state.datetime) is set as current date / time in the constructor method.
The process is to complete the form and press submit (where a report time /date is selected and stored)- the form is then sent to the server and the form component is then removed and a completed component displayed - which shows the committed data and contains an edit button.
If we press the edit button - for some reason the date={this.state.datetime} reverts to the current date / time and not (this.state.datetime) value. We can see that (this.state.datetime) is the correctly saved data - but for some confusing reason it does not update. However when updating the date the onDateChange function is updating the (this.state.datetime) value and the displayed value alters.
Can anyone shine any light / offer any advice please?
Issue
We have setup the datepicker as follows:
We have the above implementation of datepicker within a report form. The (this.state.datetime) state is linked to a redux state. The initial state (this.state.datetime) is set as current date / time in the constructor method.
The process is to complete the form and press submit (where a report time /date is selected and stored)- the form is then sent to the server and the form component is then removed and a completed component displayed - which shows the committed data and contains an edit button.
If we press the edit button - for some reason the date={this.state.datetime} reverts to the current date / time and not (this.state.datetime) value. We can see that (this.state.datetime) is the correctly saved data - but for some confusing reason it does not update. However when updating the date the onDateChange function is updating the (this.state.datetime) value and the displayed value alters.
Can anyone shine any light / offer any advice please?