You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a Day-based React-Datepicker used inside a Formik form, which may or may not be relevant (I followed this small Formik wrapper). When the React-Datepicker is initialized to a form value that has a timestamp, such as new Date(), then any day selection returns the current timestamp. On the other hand, when it's initialized to something like NULL, any day selection returns 00:00:00. I need zero-time 00:00:00 returned in both of these cases.
Datepicker 1 in Formik form initialized to new Date(). Note that any date selection includes the current timestamp in the value.
Datepicker 2 in Formik form initialized to NULL. Note that any date selection includes the 00:00:00 timestamp.
Expected behavior
Even if the DatePicker is initialized to a form value of new Date(), it should still return 00:00:00 on any Day selection. Regardless of how it is initialized, the value set by a day-based React-DatePicker such as in this example should always be 00:00:00 (no time, just the date).
The text was updated successfully, but these errors were encountered:
This is strange indeed, it's not caused by Formik, I've modified your sandbox and added some datepickers that use state instead on formik and the same happens here also: https://codesandbox.io/s/affectionate-engelbart-sl61c
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
I have a Day-based React-Datepicker used inside a Formik form, which may or may not be relevant (I followed this small Formik wrapper). When the React-Datepicker is initialized to a form value that has a timestamp, such as new Date(), then any day selection returns the current timestamp. On the other hand, when it's initialized to something like NULL, any day selection returns 00:00:00. I need zero-time 00:00:00 returned in both of these cases.
To Reproduce
CodeSandBoxIO Demo:
https://codesandbox.io/s/proud-dust-gb25u
In this demo:
Expected behavior
Even if the DatePicker is initialized to a form value of new Date(), it should still return 00:00:00 on any Day selection. Regardless of how it is initialized, the value set by a day-based React-DatePicker such as in this example should always be 00:00:00 (no time, just the date).
The text was updated successfully, but these errors were encountered: