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

Move datetime-specific code from date methods into datetime class #154

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

5j9
Copy link
Contributor

@5j9 5j9 commented Apr 7, 2024

Simplifies the logic and improves readability by moving datetime-specific code branches to datetime class.
Also resolves some code linter warnings about attributes not being defined on date class.

_strftime_p: only raises Exception (AttributeError) on date objects because dates do not have hour attribute.

_strftime_z: only raises AttributeError on a date class becuase date does not have utcoffset attribute.

_strftime_cap_z: date does not have tzname attribute, but datetime has.

@hramezani
Copy link
Collaborator

@5j9 please rebase on top of main

_strftime_p: only raises Exception (AttributeError) on date objects
because dates do not have hour attribute.

_strftime_z: only raises AttributeError on a date class becuase
date does not have utcoffset attribute.

_strftime_cap_z: date does not have tzname attribute, but
datetime has.
@hramezani
Copy link
Collaborator

Thanks @5j9

@hramezani hramezani merged commit 06352d5 into slashmili:main Apr 7, 2024
8 checks passed
@5j9 5j9 deleted the split-dt-specific branch April 8, 2024 02:36
@slashmili
Copy link
Owner

Nice work @5j9 👍🏼

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 this pull request may close these issues.

3 participants