Skip to content
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

HvDatePicker is not accepting date for value prop. #2250

Closed
dpanda-hv opened this issue Feb 9, 2021 · 3 comments
Closed

HvDatePicker is not accepting date for value prop. #2250

dpanda-hv opened this issue Feb 9, 2021 · 3 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@dpanda-hv
Copy link

Describe the bug
HvDatePicker is giving type error for value property with React Typescript. Expected value is Date type but prop type is mentioned as string.

<HvDatePicker label="Date" startAdornment={null} value={new Date()} />
(JSX attribute) HvDatePickerProps.value?: string | undefined
The initial value of the input when in single calendar mode.

Type 'Date' is not assignable to type 'string'.ts(2322)
DatePicker.d.ts(39, 3): The expected type comes from property 'value' which is declared here on type 'IntrinsicAttributes & HvDatePickerProps'

To Reproduce
Steps to reproduce the behavior:

  1. Create a react component(using typescript) that uses HvDatePicker .
  2. Pass default date value.

Expected behavior
It should accept Date.

Screenshots
image

Enviroment (please complete the following information):

  • Device: Laptop
  • OS: RHEL 8
  • Browser: Chrome
  • Version 3.8.1

Additional context
NA

@diogofscmariano diogofscmariano added the 🐛 bug Something isn't working label Feb 12, 2021
@diogofscmariano
Copy link
Contributor

hi @dpanda-hv, we included the fix for this bug in the latest release. Can you please upgrade on your side and check if it is fixed?

@dpanda-hv
Copy link
Author

Verified. Issue got fixed in the latest build. Thanks @diogofscmariano

@diogofscmariano
Copy link
Contributor

You're welcome :) we are happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants