DEV Community

Alexander Samaniego
Alexander Samaniego

Posted on • Updated on

Hacktoberfest Week 3: Enhancing a Feature

For the third week of Hacktoberfest, I wanted to continue contributing to the same project from week 2 and adding to my previous contributions.

Project Recap

To recap the project from the previous week, the project repo called Remotebirdjobs. This is a website that searches Twitter for job posting Tweets based on a programming topic/language (i.e. React, C++, JavaScript, etc.) within a date range. The project is built using React.js.

The Issue

I found another issue (issue #19) within the project that was closely related to the previous issue I worked on (issue #34).

The issue was again related to the date picker used to select the date range. The issue proposes new changes that will add logic to prevent a date being selected that is less than the start date. The project maintainer also requested to have the start date and end date be selected at the same time, without needing to have two different input fields and only opening the date picker once.

Fixing the Issue

To fix the issue, I used the same <DatePicker/> component so I wouldn't have to change much or install other components. I tried brainstorming and experimenting with other React date pickers and components, but none worked as well as I had hoped. So, I stuck with the component in currently in use. I added some React state hooks to handle the the start and end date changes. Then readjusted the onChange attribute to call the onChange() function I created to call the state hooks and change the start and end dates. I also added some attributes that enables range selection and month/year dropdown menus for date easy selection. I also deleted the second date picker and increased the width of the sole date picker.

The Pull Request

Once the changes were made I created the pull request (PR). The PR described every changes I made and my reasoning behind the changes and additions. The project maintainer has not commented nor merged the PR as of yet, but I will update the blog and discuss any potential changes that may be requested.

Conclusion

The PR for this week was definitely challenging as the brainstorming and experimenting with other components took up the most time. I'm glad to have experienced working on the same repo and adding to my previous contributions. Now I look forward to the final week of Hacktoberfest and the last PR for this assignment.

Top comments (0)