Skip to content

Humanize Format Relative Error For Multiple Granularities #996

Closed
@anishnya

Description

@anishnya

Issue Description

System Info

  • 🖥 OS name and version:
  • 🐍 Python version:
  • 🏹 Arrow version:
    import arrow
    arw = arrow.Arrow(2013, 1, 1, 0, 0, 0)
    later = arw.shift(seconds=3600)
    humanize_string = arw.humanize(later, granularity=["second", "hour", "day", "month", "year"],)
    print(humanize_string)
    >>> "in 0 years 0 months 0 days an hour and 0 seconds"

"in 0 years 0 months 0 days an hour and 0 seconds" should be "0 years 0 months 0 days an hour and 0 seconds ago". I suspect this is dude to the fact in describe-mutli we take timeframes[-1], which in this case would be 0. This results in format relative defaulting to it's positive version. We might need a linear search through all the timeframe units to better determine the correct relative phrase to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions