🩹 Singular/plural forms for time counts. #1217
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Feature
Overview
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 of1 weeks
it will return1 week
.I have reviewed the usage of the
getTimeDifference
function in the following places:src/components/Widgets/DroneCi.vue
src/components/Widgets/GlAlerts.vue
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)
None
Screenshot (if applicable)
Code Quality Checklist (Please complete)