Skip to content

add support for "maxRelativeTimeUnit" for .fromNow() and .from()#322

Draft
kimmanwky wants to merge 1 commit into
jama5262:masterfrom
kimmanwky:maxRelativeTimeUnit
Draft

add support for "maxRelativeTimeUnit" for .fromNow() and .from()#322
kimmanwky wants to merge 1 commit into
jama5262:masterfrom
kimmanwky:maxRelativeTimeUnit

Conversation

@kimmanwky

Copy link
Copy Markdown
Contributor

What does this PR do?

Add new optional parameters ("maxRelativeTimeUnit") for methods - Jiffy().fromNow() and Jiffy().from().

This parameters allow the relative time to be shown at defined maxRelativeTimeUnit (minute, hour, day, month).

For example,

"[in] 365 days [ago]", instead of "[in] 1 year [ago]"
"[in] 60 days [ago]", instead of "[in] 2 months [ago]"
"[in] 48 hours [ago]", instead of "[in] 2 days [ago]"

Issue Reference

Fixes #

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance change (non-breaking change such as upgrading a dependency, refactoring, or making a lint fix)
  • Documentation update
  • Breaking change (a fix or feature that would cause existing functionality to change)

Screenshots

If applicable, add screenshots to help explain your problem.

Checklist

  • Wrote additional tests, if needed
  • All tests have passed, you can find the scripts from the ./bin folder
  • I have updated the documentation accordingly, if needed.

Additional Information

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.

1 participant