Closed uigywnkiub closed 45 minutes ago
When you clear the field the value becomes null
. You could make this change const startYear = startDate && format(startDate, "y")
I could reproduce the error in stories and in docs (https://nextui.org/docs/components/date-range-picker#presets).
@wingkwong can i work on this and create a PR?
@ShrinidhiUpadhyaya Assigned. Feel free to ping me if you have any questions.
NextUI Version
2.4.2
Describe the bug
DateRangePicker throws an error when I clear any time data. Select any field value and delete numbers to zero.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Expected behavior
I guess it must be 0 or an empty field without throwing an error.
Screenshots or Videos
My code
Video
https://github.com/nextui-org/nextui/assets/29861553/b6919b58-85c2-452d-b3ef-d77bd1526ac0
On your site also error.
Operating System Version
Browser
Chrome