Skip to content
Snippets Groups Projects
Commit b44dc14f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unused code removed

parent e9d05514
No related branches found
No related tags found
1 merge request!336Pylint checks
......@@ -417,7 +417,7 @@ def prepare_test_redcap_connection():
url_item.save()
def datetimeify_date(date, timezone=datetime.timezone.utc):
def datetimeify_date(date):
if isinstance(date, datetime.date): # If it's date, then just make sure that timezone support is there
if is_aware(date):
return date
......@@ -427,15 +427,6 @@ def datetimeify_date(date, timezone=datetime.timezone.utc):
date = date.decode('utf8')
if isinstance(date, str): # If it's string, convert to datetime with timezone support
return make_aware(datetime.datetime.strptime(date, '%Y-%m-%d'))
"""
if len(date) < 8:
actual_length = str(len(date))
message = "The string representation of date should have at least 8 characters (YYYY-M-D)! But it has: {} characters instead.".format(actual_length)
raise TypeError(message)
separator = date[4] if not date[4].isdigit() else date[2]
year, month, day = date.split(separator)
return datetime.datetime(int(year), int(month), int(day), tzinfo=datetime.timezone.utc)
"""
actual_type = str(type(date))
raise TypeError(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment