Skip to content

Filter Conferences by Date Range#761

Merged
JuanPabloDiaz merged 21 commits intotech-conferences:mainfrom
JuanPabloDiaz:Filter-by-Date-Range
Jul 14, 2025
Merged

Filter Conferences by Date Range#761
JuanPabloDiaz merged 21 commits intotech-conferences:mainfrom
JuanPabloDiaz:Filter-by-Date-Range

Conversation

@JuanPabloDiaz
Copy link
Contributor

@JuanPabloDiaz JuanPabloDiaz commented Sep 11, 2024

@cgrail
Copy link
Member

cgrail commented Sep 11, 2024

Looks good. But there is a compile error

@JuanPabloDiaz
Copy link
Contributor Author

Looks good. But there is a compile error

I finally got it lol

@JuanPabloDiaz
Copy link
Contributor Author

JuanPabloDiaz commented Sep 13, 2024

I am happy how it turns out

Let's test it!

image

@nimzco
Copy link
Member

nimzco commented Sep 14, 2024

Hey @JuanPabloDiaz, thank you for this proposal and this PR!

In terms of usability, how about only showing months instead of full dates in the picker? I'm even thinking, only showing one month, to be like: "show me conference after this date".

If we were to keep start and end date, I would like the filter to update as soon as I select the start date. Meaning: I don't need to select the end date to see the conference list change.
Additionally, we need to handle the mobile view, or to hide it on mobile.


const handleStartDateSelect = (date: Date | null) => {
if (date) {
setStartDate(date)
Copy link
Member

@nimzco nimzco Sep 14, 2024

Choose a reason for hiding this comment

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

Don't you want to handle when the user empties the input? (comment is meant for the line above)

.dateRangePicker {
display: flex;
width: 400px;
padding: 2px;
Copy link
Member

Choose a reason for hiding this comment

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

This padding breaks the vertical alignment, see:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow, I had to zoom in to see that.

Great catch! I will work on it

@JuanPabloDiaz
Copy link
Contributor Author

Hi @nimzco @cgrail,

I am happy with how it turns out. Here is the summary of this PR:

date.mov

This pull request introduces a date range filter to the Conference List page, allowing users to filter conferences by start and end dates. It also includes styling updates and minor code improvements. Below is a summary of the most important changes:

🎉 New! Filter conferences by date range

  • Added startDate and endDate state variables to the ConferenceListPage component, along with handlers to manage date selection and validation (src/scenes/ConferenceList/ConferenceList.tsx).
  • Integrated react-datepicker for date selection, including importing the library and its styles (src/scenes/ConferenceList/ConferenceList.tsx). [1] [2]
  • Updated the ConferenceList component to accept startDate and endDate as props and filter conferences based on the selected date range (src/scenes/ConferenceList/components/ConferenceList/ConferenceList.tsx). [1] [2] [3]

Styling Updates

  • Added styles for the date range picker and its clear button in ConferenceList.module.scss and ConferenceListPage.module.scss to ensure proper layout and responsiveness (src/scenes/ConferenceList/ConferenceList.module.scss, src/scenes/ConferenceList/components/ConferenceList/ConferenceList.module.scss). [1] [2]

Minor Improvements

  • Added width: 100% to the Search component for better alignment and responsiveness (src/components/Search/Search.module.scss).
  • Suppressed prettier warnings for certain lines in scripts/heroku-start.js to improve code readability without formatting conflicts.
  • Added a Clear button
  • Follow the responsive design
  • Proper alignment of all date picker elements

nimzco
nimzco previously requested changes Jul 12, 2025
Copy link
Member

@nimzco nimzco left a comment

Choose a reason for hiding this comment

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

A few comments, but it looks good!

When selecting a start date, I would expect the results to change. They don't until we select the end date.
We could also auto-open the end-date after selecting the start-date, but I would start filtering already.

UI:

  • The height of the inputs are not the same with the search
  • The X is not center-aligned.
image

- Filter results immediately on start date selection
- Auto-focus end date picker for better UX
- Fix alignment between search box and date inputs
- Enhance date range overlap detection
- Improve dark mode and accessibility
@JuanPabloDiaz
Copy link
Contributor Author

Thanks for your feedback @nimzco! I've implemented your suggestions, and everything should now be working as you requested.

fixed.mov

feat: improve date filtering UX and fix input alignment

  • Filters now apply immediately upon selecting start or end dates.
  • Auto-focus end date picker for better UX
  • Fix alignment between search box and date inputs
  • Enhance date range overlap detection
  • Improve dark mode and accessibility

@JuanPabloDiaz JuanPabloDiaz requested a review from nimzco July 13, 2025 00:45
@JuanPabloDiaz JuanPabloDiaz self-assigned this Jul 13, 2025
@JuanPabloDiaz JuanPabloDiaz dismissed nimzco’s stale review July 13, 2025 00:47

I follow his feedback and I've implemented his suggestions

.Search {
margin-bottom: spacing.spacing();
width: 100%;
margin: 0; // Remove bottom margin that might affect alignment
Copy link
Member

Choose a reason for hiding this comment

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

You need to keep the margin bottom. The search bar is smooshed with the filters below.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I restored margin-bottom. I though it was conflicting with the aligment but its not longer a problem.

@nimzco
Copy link
Member

nimzco commented Jul 13, 2025

When testing locally, the conference list don't update anymore after I change the dates.

@JuanPabloDiaz
Copy link
Contributor Author

When testing locally, the conference list don't update anymore after I change the dates.

Hmm, it doesn’t update when you only change the dates @nimzco?

It works for me when I test the date filter alone. I still need to work on how this new feature interacts with other filters when combined.

@JuanPabloDiaz
Copy link
Contributor Author

Thanks @nimzco! You're absolutely right.

Date filtering was client-side while other filters were server-side, causing conflicts.

Fixed! Moved date filtering to Algolia level so it works with other filters.

Should be working now! 🎯

Comment on lines 50 to 66
.dateRangePicker {
display: flex !important;
flex-direction: row !important; // Force it to be in a row
gap: 0.5rem !important;
align-items: center !important;
padding: 0.5rem !important;

.customDatePicker {
border: 1px solid #d1d5db !important;
padding: 0.25rem !important;
width: auto !important;
max-width: 12rem !important;
height: 35px !important;
color: black !important;
border-radius: 0.375rem !important;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure all of this is needed? I don't see the CSS applied and if I remove the code, the behavior is still the same. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, I forgot to remove that. I add it in this commit but we no longer need it.

Copy link
Member

@nimzco nimzco left a comment

Choose a reason for hiding this comment

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

Aside of my last comment. I've tested locally, and it works as expected. 🚢
Thanks for the feature addition!

@JuanPabloDiaz JuanPabloDiaz merged commit a195bd9 into tech-conferences:main Jul 14, 2025
4 checks passed
@JuanPabloDiaz JuanPabloDiaz deleted the Filter-by-Date-Range branch July 14, 2025 01:38
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