-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pickers] DateTimePicker value is of type ChangeEvent<HTMLInputElement> #8923
Comments
Hello, from what I can see given the screenshot, it seems that the culprit might be the incorrect If you are still having issues, could you provide a minimal working reproduction example of your issue? |
What was the reason that you were expecting the |
Thank you for your answer. The reason I expected it to have those parameters is because most of MUI's fields are based on the basic input, so I was pretty confused that it was not applicable here. I'm not sure how to apply this to my code exactly however as I excluded some properties from the object here as it was for demonstration purposes only. I require the two dates to be strings because they are stored in json in a blob storage. Would a correct solution be to create a custom type and convert it to the necessary json format later on? |
That is a fair assumption. We already had similar considerations to include the event in the
Firstly, I'd suggest having a bit more complete type for the Basically, if you are receiving the object with dates as strings, you need to decide on a place where to transform it into |
I should be able to find a solution with this information. I may not be able to implement it immediately however, so I will keep you posted when the time comes and close this issue when I've produced a solution. |
Hello @RK21898. The issue has been open for half a year without any activity. 🙈 |
Duplicates
Latest version
Steps to reproduce 🕹
What you see is what you get so I cannot really provide any reproduction. The closest to reproduction steps that I can offer would be:
npm install @mui/x-date-pickers
npm install moment
DateTimePicker
value, minTime or maxTime propertyCurrent behavior 😯
Currently when I try to pass a value to any of the
DateTimePicker
components, whether it is standard, mobile or etc, I receive the following error. This happens on both the value and minTime property as shown below, and I am therefore unable to create a controlled DateTimePicker.Expected behavior 🤔
What I expect that would happen is that it accepts either a
Moment
object or possibly astring
Context 🔦
I am trying to create a dialog that creates a new object to pass through a data grid and a blob storage respectively, this is however out of scope for the problem at hand, as the issue is solely with the
DateTimePicker
component.With the
DateTimePicker
component I am trying to provide a custom object with two date values via change events.Your environment 🌎
npx @mui/envinfo
It says that Chrome is not found, I am however definitely working with Chrome.
Order ID or Support key 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: