kennethreitz / maya

Datetimes for Humans™
MIT License
3.41k stars 199 forks source link

AttributeError: 'MayaDT' object has no attribute 'snap_tz' #194

Closed paregorios closed 2 years ago

paregorios commented 2 years ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/timofurrer/maya/blob/master/.github/CONTRIBUTING.md

[x] I have read and respect the code of conduct at https://github.com/timofurrer/maya/blob/master/.github/CODE_OF_CONDUCT.md

[x] I have searched the existing issues and I'm convinced that mine is new.

Describe the bug AttributeError: 'MayaDT' object has no attribute 'snap_tz'

Environment and Version

To Reproduce

⌘ python
Python 3.9.7 (default, Sep 28 2021, 17:18:05) 
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import maya
>>> dt = maya.when('today')
>>> dt.iso8601()
'2021-10-13T21:42:19.298245Z'
>>> dt.snap_tz('+6h@d', 'CDT').rfc2822()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'MayaDT' object has no attribute 'snap_tz'

Expected behavior As in package README:

>>> dt = maya.when('Mon, 21 Feb 1994 21:21:42 GMT')
>>> dt.snap_tz('+3h@d', 'Australia/Perth').rfc2822()
    'Mon, 21 Feb 1994 16:00:00 GMT'

Screenshots If applicable, add screenshots to help explain your problem.

Relevant log files If applicable, information from log files supporting your claim.

Additional context Add any other context about the problem here.

paregorios commented 2 years ago

Ah, I see this has not made it into a release yet: https://github.com/timofurrer/maya/commit/0a7061c1258650f8b2ad4479f3cdecbc56fcf7de