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

[bug report] Filter function 'between' thow an exception when the second parameter value is null. #9765

Closed
RobersonLuo opened this issue Jan 14, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@RobersonLuo
Copy link

PrimeNG version: 11.1.0
primeng-api.js
code line 1, the last "filter[0]" should be changed to "filter[1]"

between: (value, filter) => {
1    if (filter == null || filter[0] == null || filter[0] == null) {
2       return true;
    }
    if (value === undefined || value === null) {
        return false;
    }
    if (value.getTime)
        return filter[0].getTime() >= value.getTime() && value.getTime() <= filter[1].getTime();
    else
        return filter[0] <= value && value <= filter[1];
}

please have a check, thanks.

@yigitfindikli yigitfindikli self-assigned this Jan 14, 2021
@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 14, 2021
@yigitfindikli yigitfindikli added this to the 11.2.0 milestone Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants