Created
July 11, 2018 10:13
-
-
Save jattoabdul/a2a89631dbaacbdbaca84d28d19a039a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __convert_to_date(self, date_string): | |
today = date.today() | |
if date_string == 'today': | |
return today | |
elif date_string == 'yesterday': | |
return today - timedelta(days=1) | |
elif date_string == 'tomorrow': | |
return today + timedelta(days=1) | |
else: | |
return today |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment