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

duration months cannot be added to other durations #479

Closed
2 tasks done
dagraham opened this issue Jun 9, 2020 · 1 comment · Fixed by #482
Closed
2 tasks done

duration months cannot be added to other durations #479

dagraham opened this issue Jun 9, 2020 · 1 comment · Fixed by #482

Comments

@dagraham
Copy link

dagraham commented Jun 9, 2020

  • I am on the latest Pendulum version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name:
  • Pendulum version:

Issue

>>> pendulum.duration(weeks=1) + pendulum.duration(months=1) + pendulum.duration(days=1)
Duration(weeks=1, days=1)

Note that adding months=1 has no effect.

@dagraham
Copy link
Author

dagraham commented Jun 9, 2020

This may be related to the fact that a duration of months evaluates to False:

>>> du = pendulum.Duration(months=1)
>>> if du:
...     print('Yes')
... 
>>> du = pendulum.Duration(weeks=1)
>>> if du:
...     print('Yes')
... 
Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant