Open gehrmanng opened 1 year ago
Can we have the working example of the solution with reactive form in stackblitz?
Seeing the same problem. Cant use [(ngModel)] with keepDatesOutOfRules: true and minDate
here is a working stackblitz of the issue. https://stackblitz.com/~/github.com/rahul71/ngx-datepicker-demo @VirendraMaheta7 ^ @gehrmanng ^
Any help would be appreciated.
Bug description: When using BsDatepicker with a minDate, the configuration option "keepDatesOutOfRules: true" only works when the datepicker value is set by [bsValue]. When using Angular Forms [(ngModel)] or Angular Reactive Forms formControlName="..." instead, an invalid date value gets overwritten by the configured minDate.
Plunker/StackBlitz that reproduces the issue: Please find a working demo project here: https://github.com/gehrmanng/bs-datepicker-test and a StackBlitz here: https://stackblitz.com/edit/github-4ravqg
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 10.3.0 Angular: 15.2.0 Bootstrap: 5.2.3
Build system: Angular CLI / NPM
Expected behavior I would expect the datepicker to keep the invalid date value when the "keepDatesOutOfRules" option is set to true.