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

add test and change code using date transformation [0.25h+0.25h] #17

Closed
2 tasks
epogrebnyak opened this issue Jun 21, 2022 · 1 comment
Closed
2 tasks
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@epogrebnyak
Copy link
Owner

def date_only(s):
return s[: 4 + 2 + 2 + 2] # TODO: change to date

This function cuts a date out of longer string just as first several chcracter in a string, It works, bitnot clean.

  • create test_date-only() in test_github.py
  • suggest code chage for this function
@epogrebnyak epogrebnyak added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 21, 2022
@epogrebnyak epogrebnyak changed the title add test and change code using date transformation add test and change code using date transformation [0.25h+0.25h] Jun 21, 2022
@epogrebnyak
Copy link
Owner Author

epogrebnyak commented Jun 22, 2022

possible fix

#! poetry add arrow
def date_only(s: str) -> datetime.date:
  return arrow.get(s).date()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant