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

Switching between date filter widget type in field filters show NaN dates #16756

Closed
paoliniluis opened this issue Jun 24, 2021 · 0 comments · Fixed by #18256
Closed

Switching between date filter widget type in field filters show NaN dates #16756

paoliniluis opened this issue Jun 24, 2021 · 0 comments · Fixed by #18256
Assignees
Labels
.Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Milestone

Comments

@paoliniluis
Copy link
Contributor

paoliniluis commented Jun 24, 2021

Describe the bug
When switching the filter widget type in date field filters makes the filter to show invalid dates. For example: switching between a date range filter and single date.

Logs
Seems like a frontend issue only:

Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 2019-09-07~2019-09-30, _f: undefined, _strict: undefined, _locale: [object Object]

To Reproduce

  1. Build a native sql query on the sample dataset:
SELECT * FROM ORDERS WHERE {{date}}
  1. set the date filter as a field filter to the date field of the orders table. Set the type as a range type
  2. set the filter to a range like Oct-1-2019 / Oct-30-2019
  3. change the filter type to a single date type

Expected behavior
Filter to be cleared so user can input a date and does not see an error

Screenshots
field_filter_date

Information about your Metabase Installation:

  • Your browser and the version: Brave latest
  • Your operating system: Ubuntu LTS latest
  • Your databases: Sample
  • Metabase version: 0.39.4
  • Metabase hosting environment: Docker
  • Metabase internal database: Postgres

Severity
Not severe, a FE glitch that can be bypassed by clicking on the cross and cleaning the filter

Additional context
None

@paoliniluis paoliniluis added Type:Bug Product defects .Needs Triage .Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround and removed .Needs Triage Type:Bug Product defects labels Jun 24, 2021
@flamber flamber added the Querying/Parameters & Variables Filter widgets, field filters, variables etc. label Jul 23, 2021
@ranquild ranquild self-assigned this Oct 1, 2021
@ranquild ranquild added this to the 0.42 milestone Oct 6, 2021
@rlotun rlotun modified the milestones: 0.42, 0.41.1 Oct 7, 2021
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Mar 31, 2022
nemanjaglumac added a commit that referenced this issue Mar 31, 2022
nemanjaglumac added a commit that referenced this issue Apr 1, 2022
nemanjaglumac added a commit that referenced this issue Apr 2, 2022
* Extract repro for #16756

* Optimize looping through sql date field fitlers

* Optimize looping through sql number field fitlers

* Optimize looping through sql string field fitlers

* Extract common helper

* Run only native filters in the current branch

* Reduce flakiness in `type`

* Merge field filters together

* Run tests on `master` again
This was referenced Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Querying/Parameters & Variables Filter widgets, field filters, variables etc. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants