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

Humanizegranularity #388

Merged
merged 4 commits into from
Dec 31, 2016
Merged

Conversation

galaplexus
Copy link
Contributor

New feature allowing to select the granularity of the humanize function. We can receive for example 65 minutes ago rather than 1 hour ago.

@codecov-io
Copy link

codecov-io commented Dec 5, 2016

Current coverage is 100% (diff: 100%)

Merging #388 into master will not change coverage

@@           master   #388   diff @@
====================================
  Files          14     14          
  Lines        2944   3011    +67   
  Methods         0      0          
  Messages        0      0          
  Branches      215    224     +9   
====================================
+ Hits         2944   3011    +67   
  Misses          0      0          
  Partials        0      0          

Powered by Codecov. Last update 4996bc9...9c6dee4

''' Returns a localized, humanized representation of a relative difference in time.

:param other: (optional) an :class:`Arrow <arrow.arrow.Arrow>` or ``datetime`` object.
Defaults to now in the current :class:`Arrow <arrow.arrow.Arrow>` object's timezone.
:param locale: (optional) a ``str`` specifying a locale. Defaults to 'en_us'.
:param only_distance: (optional) returns only time difference eg: "11 seconds" without "in" or "ago" part.

:param granularity: (optinal) defines the precision of the output. Set it to strings 'second', 'minute', 'hour', 'day', 'month' or 'year'.

Choose a reason for hiding this comment

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

typo: optinal

Also, it'd be good if you could include some usage examples in the PR comments.

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.

4 participants