mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix dateutil import
This commit is contained in:
parent
140d04abaf
commit
b34b48fdc1
1 changed files with 3 additions and 8 deletions
|
@ -17,7 +17,6 @@ import xbmcgui
|
||||||
import xbmcvfs
|
import xbmcvfs
|
||||||
|
|
||||||
from . import _
|
from . import _
|
||||||
from libraries.dateutil import tz, parser
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -450,8 +449,10 @@ def convert_to_local(date):
|
||||||
|
|
||||||
''' Convert the local datetime to local.
|
''' Convert the local datetime to local.
|
||||||
'''
|
'''
|
||||||
|
from libraries.dateutil import tz, parser
|
||||||
|
|
||||||
try:
|
try:
|
||||||
date = convert_str_to_date(date) if type(date) in (unicode, str) else date
|
date = parser.parse(date) if type(date) in (unicode, str) else date
|
||||||
date = date.replace(tzinfo=tz.tzutc())
|
date = date.replace(tzinfo=tz.tzutc())
|
||||||
date = date.astimezone(tz.tzlocal())
|
date = date.astimezone(tz.tzlocal())
|
||||||
|
|
||||||
|
@ -460,9 +461,3 @@ def convert_to_local(date):
|
||||||
LOG.error(error)
|
LOG.error(error)
|
||||||
|
|
||||||
return str(date)
|
return str(date)
|
||||||
|
|
||||||
def convert_str_to_date(date):
|
|
||||||
|
|
||||||
''' Convert string to date.
|
|
||||||
'''
|
|
||||||
return parser.parse(date)
|
|
||||||
|
|
Loading…
Reference in a new issue