Skip to content

Multiple units in format_timedelta() #728

@Jackenmen

Description

@Jackenmen

Would it be possible to return more than just one unit for passed timedelta object?
For example:

>>> format_timedelta(timedelta(days=2, hours=5, minutes=2, seconds=5), granularity=3)
'2 days, 5 hours, and 2 minutes'

Note: granularity is already used for something else in format_timedelta(), so that kwarg would need to be called differently, I just couldn't think of better name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions