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

🩹 Singular/plural forms for time counts. #1217

Merged
merged 3 commits into from
Jun 10, 2023

Conversation

altearius
Copy link
Contributor

@altearius altearius commented Jun 8, 2023

altearius Medium altearius /FEATURE/temporal-plurality → Lissy93/dashy Commits: 3 | Files Changed: 1 | Additions: 15 Label Unchecked Tasks Powered by Pull Request Badge

Thank you for contributing to Dashy! So that your PR can be handled effectively, please populate the following fields (delete sections that are not applicable)

Category:

One of: Bugfix / Feature / Code style update / Refactoring Only / Build related changes / Documentation / Other (please specify)

Feature

Overview

Briefly outline your new changes...

The getTimeDifference utility function presently returns values using the plural forms of whatever noun is chooses, disregarding the actual count.

If merged, this PR will update the getTimeDifference to use the singular form of the respective noun if there is only a single item of that unit. For instance, instead of 1 weeks it will return 1 week.

I have reviewed the usage of the getTimeDifference function in the following places:

  • src/components/Widgets/DroneCi.vue
  • src/components/Widgets/GlAlerts.vue
  • Elsewhere within src/utils/MiscHelpers.js

And I have not identified any potential issues.

N.B. - I suggest that this code should largely be replaced with a dependency, perhaps pretty-ms, but I do not feel empowered to make such a change, at least not without approval of a maintainer.

Issue Number (if applicable) #00

None

New Vars (if applicable)

If you've added any new build scripts, environmental variables, config file options, dependency or devDependency, please outline here

None

Screenshot (if applicable)

If you've introduced any significant UI changes, please include a screenshot

image

Code Quality Checklist (Please complete)

  • All changes are backwards compatible
  • All lint checks and tests are passing
  • There are no (new) build warnings or errors
  • (If a new config option is added) Attribute is outlined in the schema and documented
  • (If a new dependency is added) Package is essential, and has been checked out for security or performance
  • Bumps version, if new feature added

@altearius altearius requested a review from Lissy93 as a code owner June 8, 2023 23:25
@netlify
Copy link

netlify bot commented Jun 8, 2023

Deploy Preview for dashy-dev ready!

Name Link
🔨 Latest commit 03ae385
🔍 Latest deploy log https://app.netlify.com/sites/dashy-dev/deploys/648266bbe9e7d70008b6fd2e
😎 Deploy Preview https://deploy-preview-1217--dashy-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@viezly
Copy link

viezly bot commented Jun 8, 2023

Changes preview:

Legend:

👀 Review pull request on Viezly

Copy link
Owner

@Lissy93 Lissy93 left a comment

Choose a reason for hiding this comment

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

Thanks @altearius - looks great :)

@Lissy93 Lissy93 merged commit d718905 into Lissy93:master Jun 10, 2023
12 checks passed
@altearius altearius deleted the FEATURE/temporal-plurality branch June 10, 2023 22:45
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.

None yet

2 participants