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

fix(nb-rangepicker): improve validators #2834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chirichok98
Copy link
Contributor

@chirichok98 chirichok98 commented Aug 17, 2021

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Fixes #2517

MinValidator and MaxValidator were thinking that value is a Date.
Problem was that for rangePicker its an object with {start: Date, end: Date}.
Modified validators to think about start and end values (P.S. if they exist)

@yggg yggg added this to the 9.1.0 milestone Nov 30, 2021
@timoschlueter
Copy link

I just faced a problem linked to this in one of our clients applications:

ERROR TypeError: Cannot read properties of undefined (reading 'match')
    at parseNumericPattern (utils.mjs:20:34)
    at parseNDigits (utils.mjs:71:14)
    at DateParser.parse (DateParser.mjs:26:28)
    at DateParser.run (Parser.mjs:5:25)
    at parse (parse.mjs:426:34)
    at NbDateFnsDateService.parse (nebular-date-fns.mjs:25:21)
    at NbRangeAdapterService.parse (nebular-theme.mjs:24962:35)
    at NbDatepickerDirective.minValidator (nebular-theme.mjs:7890:45)
    at forms.mjs:790:40
    at Array.map (<anonymous>)

The problem occurs when we are using a RangePicker with a Reactive Form. This PR seems to be related to the problem. What are the chances that this will get merged into ne next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

date.clone is not a function in NbRangepicker
3 participants