nebular
nebular copied to clipboard
nb-datepicker with [min] and not required throwing validation error when cleared
Issue type
I'm submitting a ... (check one with "x")
- [x] bug report
- [ ] feature request
Issue description
Current behavior: Setting a [min] date for the nb-datepicker on a reactive form control that is not required. Setting the date, and then clearing the date causes the form validation to be invalid with { errors: { nbDatepickerMin: { actual: Invalid Date {}, min: Fri Jan 01 2021 00:00:00 } } }
Expected behavior: Clearing the date should set the value to empty string or null (I've tried both) and still be valid upon submit.
Steps to reproduce: Set the date. Then clear the date. the form control is now invalid
Related code: https://stackblitz.com/edit/github-jt9t8j?file=src%2Fapp%2Fapp.component.html (https://github-jt9t8j.stackblitz.io)
Other information:
npm, node, OS, Browser Node: 10.14.0 OS: Windows 10 Browser: Chrome
Angular, Nebular @nebular/theme: "^6.2.1" angular: 10.2.1
+1
Any update with this issue ?
Looks like the PR https://github.com/akveo/nebular/pull/2822 hasn't been merged