Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BrewCityBoy
Copy link
Contributor

@BrewCityBoy BrewCityBoy commented Jan 25, 2024

Fix for Date range filters set to current date results in an empty chart area (#1866)

Jira DATAP-1216

This PR addresses the "0 matches" issue when the user selects the same date for the 'From' and 'Through' filter fields.

Changes

  • adds logic for adding the 'a-text-input__error' css class for same date selection (From & Through)

Testing

  • yarn test: All tests should pass
  • set From and Through filters as same date
  • verify the 'a-text-input__error' css class (red border) is displayed on both input fields

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

@flacoman91
Copy link
Contributor

Nice. The date filter component also has some logic to display an error message when someone selects start date that appears after the end date.
https://github.com/cfpb/ccdb5-ui/blob/main/src/components/Filters/DateFilter.js#L43

Can you add to this "same date" check to that logic?

I think leaving the message the same is fine, or to be more complete, you could explicitly say that the From and To dates cannot be the same.

@BrewCityBoy
Copy link
Contributor Author

@flacoman91 I had some logic in there, deleted it, then forgot to add it back. Nice catch and it's been added.

Copy link
Contributor

@flacoman91 flacoman91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good to me.

@BrewCityBoy BrewCityBoy added this pull request to the merge queue Jan 25, 2024
Merged via the queue into main with commit c47e1fc Jan 25, 2024
@BrewCityBoy BrewCityBoy deleted the joshua_date-range-filter-error branch January 25, 2024 20:43
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.

3 participants