summaryrefslogtreecommitdiff
path: root/plugin.video.spurs-tv/resources/lib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugin.video.spurs-tv/resources/lib/utils.py')
-rw-r--r--plugin.video.spurs-tv/resources/lib/utils.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugin.video.spurs-tv/resources/lib/utils.py b/plugin.video.spurs-tv/resources/lib/utils.py
index a24df58..a2bcfc6 100644
--- a/plugin.video.spurs-tv/resources/lib/utils.py
+++ b/plugin.video.spurs-tv/resources/lib/utils.py
@@ -1,10 +1,9 @@
import _strptime
import time
-from datetime import date
+from datetime import datetime, date
def date_from_str(date_str, date_format):
- return date(*(time.strptime(date_str, date_format)[0:3]))
-
-def add_item_info(item, title, item_date):
- item['info'] = {'title': title,
- 'date': item_date.strftime("%d.%m.%Y")}
+ try:
+ return datetime.strptime(date_str, date_format).date()
+ except TypeError:
+ return date(*(time.strptime(date_str, date_format)[0:3]))