-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
add date_to_weekday finder method #4599
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 date_to_weekday finder method #4599
Conversation
other/date_to_weekday.py
Outdated
day, month, year = [int(x) for x in inp_date.split("/")] | ||
if year % 100 == 0: | ||
year = "00" | ||
new_base_date: str = f"{day}/{month}/{year%100} 23:15:59" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need a time here.
other/date_to_weekday.py
Outdated
>>> date_to_weekday("1/1/2021") | ||
'Friday' | ||
""" | ||
day_list: list = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have pretty module in python so we don't need to hardcode weekdays import calendar;calendar.day_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing
Yes, but I don't get a reason why the tests are failing. |
* add date_to_weekday finder method * reformat date_to_weekday method * remove time * remove hardcode weekdays list * fix return type error * fixing fail issue * Finding the test failing issue * after testing the pre-commit in local environment
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.