5

I'm trying to set the value of an input type=date in React and I'm looking for a way to use valueAsDate and set it to a date object, is there any way to do that?

P.S. I know there are other ways to set the value but my question is specifically about valueAsDate.

4
  • What is valueAsDate? Commented Dec 27, 2019 at 18:17
  • seems to be deprecated Commented Dec 27, 2019 at 18:18
  • @fubar Chromium blog in 2011 referring to input type=date: They were disabled because of their incompleteness. It was since added back I guess see link to caniuse Commented Dec 27, 2019 at 18:34
  • @DmitryReutov Its a proeprty on input type date, and you can set it like this: input.valueAsDate = new Date() Commented Dec 27, 2019 at 18:39

1 Answer 1

3

According to this open issue in the React GitHub, this feature is not currently available in React, so the answer to your question is no.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.