When setting an initial date date={initialDate} and then press the cancel button, the date and time are reset to "now".
Thanks for reporting (even if you haven't followed the template! 馃懘 )
Looks like a bug related to this line.
I think it should be this.props.date instead of Date.now().
Willing to submit a PR and check if it fixes the issue?
This seems to work:
_resetDate = () => {
this.setState({
date: this.props.date || new Date()
});
};
@mmazzarolo sorry for don't follow the template. It was too much text 馃槥.
PR sent 馃殌
@basbase thanks for the snipet. I think || new Date() is not required since default props avoid date to be undefined.
Most helpful comment
Thanks for reporting (even if you haven't followed the template! 馃懘 )
Looks like a bug related to this line.
I think it should be
this.props.dateinstead ofDate.now().Willing to submit a PR and check if it fixes the issue?