Skip to content

Instantly share code, notes, and snippets.

@jattoabdul
Created July 11, 2018 10:13
Show Gist options
  • Save jattoabdul/a2a89631dbaacbdbaca84d28d19a039a to your computer and use it in GitHub Desktop.
Save jattoabdul/a2a89631dbaacbdbaca84d28d19a039a to your computer and use it in GitHub Desktop.
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