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

Allow humanize_timedelta to parse negative timedeltas #6199

Closed

Conversation

TrustyJAID
Copy link
Member

Description of the changes

This allows humanize_timedelta to still return something if the delta is in the negatives. A bit of a niche use case but I did encounter it since the default str representation of timedeltas isn't great.

This adds a new kwarg on humanize_timedelta if you want to explicitly pass - or some other string to represent a negative timedelta. By default this will return negative 5 hours as an example.

Have the changes in this PR been tested?

Yes

@github-actions github-actions bot added the Category: Core - API - Utils Package This is related to stuff in `redbot.core.utils` label Jul 8, 2023
@TrustyJAID
Copy link
Member Author

Closing in favor of #6350.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core - API - Utils Package This is related to stuff in `redbot.core.utils`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant