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

lib-user: Use a getDefaultDateRange() utility #6420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goplayoutside3
Copy link
Contributor

@goplayoutside3 goplayoutside3 commented Nov 4, 2024

Package

lib-user

Linked Issue

  • This is working toward an ADR and generally more documentation about how we handle date ranges for user stats and project stats.

Describe your changes

  • Define getDefaultDateRange() utility function to replace falsey date ranges like { endDate: undefined, startDate: undefined }.
  • I started this PR by documenting getDateInterval()'s handling of Javascript Dates and UTC, but realized it's much cleaner to separate out the definition of a default date range from getting the interval for the ERAS query (days, week, month, year).

How to Review

  • There's no changes needed for unit tests so all should be passing regardless of timezone
  • No UI changes either. I tested this by comparing app-root run locally and viewing my stats, homepage, and groups with no noticeable difference in the UI.

Checklist

PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.

General

  • Tests are passing locally and on Github
  • Documentation is up to date and changelog has been updated if appropriate
  • You can yarn panic && yarn bootstrap or docker-compose up --build and FEM works as expected
  • FEM works in all major desktop browsers: Firefox, Chrome, Edge, Safari (Use Browserstack account as needed)

@coveralls
Copy link

Coverage Status

coverage: 77.767% (+0.04%) from 77.729%
when pulling ad43f72 on default-date-range
into f54edb8 on master.

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.

2 participants