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

Support timezone-aware datetimes in naturaltime #100

Merged
merged 1 commit into from Mar 16, 2023
Merged

Support timezone-aware datetimes in naturaltime #100

merged 1 commit into from Mar 16, 2023

Conversation

tandav
Copy link
Contributor

@tandav tandav commented Feb 26, 2023

Fixes #17

Changes proposed in this pull request:

  • support timezone-aware datetimes in naturaltime

example:

>>> import datetime
>>> import humanize
>>> dt = datetime.datetime.now(tz=datetime.timezone.utc)
>>> humanize.naturaltime(dt)
'now'

@tandav tandav changed the title support timezone-aware datetimes in naturaltime #17 support timezone-aware datetimes in naturaltime Feb 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2023

Codecov Report

Merging #100 (ed6c3b0) into main (bdc5cb6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #100   +/-   ##
=======================================
  Coverage   99.05%   99.06%           
=======================================
  Files           9        9           
  Lines         743      749    +6     
=======================================
+ Hits          736      742    +6     
  Misses          7        7           
Flag Coverage Δ
macos-latest 97.86% <100.00%> (+0.01%) ⬆️
ubuntu-latest 97.86% <100.00%> (+0.01%) ⬆️
windows-latest 95.99% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/humanize/time.py 100.00% <100.00%> (ø)
tests/test_time.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tandav
Copy link
Contributor Author

tandav commented Feb 27, 2023

UPD: I don't have rights to assign a label to PR, so label check pipeline failed

@hugovk hugovk added the changelog: Added For new features label Feb 27, 2023
@hugovk hugovk changed the title support timezone-aware datetimes in naturaltime Support timezone-aware datetimes in naturaltime Mar 16, 2023
@hugovk hugovk merged commit 75abba2 into python-humanize:main Mar 16, 2023
@hugovk
Copy link
Member

hugovk commented Mar 16, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

naturaltime should support timezone-aware datetimes
3 participants