python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.34k stars 448 forks source link

Support multiple units in format_timedelta() #1066

Open hartmutobendorf opened 9 months ago

hartmutobendorf commented 9 months ago

Issue #728 describes returning measures for several units when using format_timedelta().

E.g. instead of

10840 seconds
3 hours

return for depth=="fullest"

3 hours 0 minutes 40 seconds

and for depth=="full"

3 hours 40 seconds

Tests are passing, but I haven't tried contributing to babel before, and am not aware of any additional requirements beyond the few lines of source code in this PR. Feedback appreciated.

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 90.94%. Comparing base (40e60a1) to head (8683607).

Files Patch % Lines
babel/dates.py 69.23% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1066 +/- ## ========================================== - Coverage 90.99% 90.94% -0.05% ========================================== Files 26 26 Lines 4444 4453 +9 ========================================== + Hits 4044 4050 +6 - Misses 400 403 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.