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

Fix/2377 Fix humanizeDate so that it always returns the date it is passed #2378

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

KameronKeller
Copy link
Contributor

Description

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.


Issue link: #2377

While writing tests for the utility functions relativeDate and humanizeDate, I identified that humanizeDate will not always return the date it is given based on the user's timezone. This stackoverflow post explains this well: https://stackoverflow.com/questions/7556591/is-the-javascript-date-object-always-one-day-off/31732581#31732581

  • This pull request adds tests for humanizeDate and relativeDate which are found here: packages/bruno-app/src/utils/common/index.js.
  • It also adds a fix to humanizeDate to ensure it always returns the date it is given

Here is a screenshot of the failing test before I implemented a fix:
image

Verification Steps

Run npm run test --workspace=packages/bruno-app

@helloanoop helloanoop merged commit 6bd9d4c into usebruno:main Aug 27, 2024
Its-treason pushed a commit to Its-treason/bruno that referenced this pull request Aug 27, 2024
…ssed (usebruno#2378)

* Add tests for humanizeDate and relativeDate

* Add fix to humanizeDate

* Fix test description
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