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

FILE-6 - Add more available date ranges to the date range dropdown #56

Closed
wants to merge 1 commit into from
Closed

Conversation

gitstart
Copy link
Contributor

What does this PR do?

Add more available date ranges to dropdown

  • Past N amount of days
  • Customizable date range
  • All monthly earnings periods from November 2022 to the current month

Issue Reference

#14

Demo

https://www.loom.com/share/db7582115b7e4d09857ec97f7dcbcd94?sid=2dc1bf95-af5a-4576-82d2-214ed2b9a268

This code was written and reviewed by GitStart Community. Growing future engineers, one PR at a time.

@gitstart gitstart marked this pull request as ready for review August 23, 2023 10:13
@gitstart
Copy link
Contributor Author

@DiegoRBaquero this PR is ready for review

@gitstart
Copy link
Contributor Author

@guanzo @joaosa @DiegoRBaquero this PR is ready for review

Copy link
Contributor

@DiegoRBaquero DiegoRBaquero left a comment

Choose a reason for hiding this comment

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

lgtm but want a second approver

@GitStartHQ GitStartHQ closed this by deleting the head repository Nov 7, 2023
startDate: Date;
endDate: Date;
} | null {
const customRangeMatch = /^(\d{4})-(\d{2})-(\d{2}) (\d{4})-(\d{2})-(\d{2})$/g.exec(dateString);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment explaining what this regex does exactly?

}
case FilterType.DateRange: {
if (periodRange.dateRange === undefined || periodRange.dateRange.startDate > periodRange.dateRange.endDate) {
throw new Error("Invalid date range");
Copy link
Contributor

Choose a reason for hiding this comment

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

Great that you're adding all this error handling in the functions. However, not seeing those errors being handled on the front end when you call this function.

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.

4 participants