I already follow the docs that works well with date object for pickup time and edit time but problem arise when i have custom time that stored in database like 04:00 PM and on edit event i have to display that time on textfield and edit but edit can't works because format is timestring.
docs: https://material-ui-pickers.dev
https://codesandbox.io/s/lucid-varahamihira-2unp9
Here the relevant code :
handleStartTimeChange(date) {
this.setState({
offerStartTime: date
});
}
editTime() {
this.setState({
custom_time: "03:00 PM"
});
}
render() {
return (
<div className="app">
<Timepicker
value={this.state.offerStartTime}
onChange={date => this.handleStartTimeChange(date)}
inputValue={this.state.custom_time}
/>
<button onClick={() => this.editTime()} style={{ marginTop: "0px" }}>
Edit
</button>
</div>
);
}