Skip to content

Commit

Permalink
make localize_date only return a string
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge authored Oct 9, 2023
1 parent ba7d342 commit ce5ae8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def localize(string_id):

def localize_date(date_string):
"""Localize date format"""
date_format = xbmc.getRegion('dateshort')
date_format = getRegion('dateshort')

try:
# A number of assumptions are made here about date_string
Expand All @@ -216,9 +216,9 @@ def localize_date(date_string):
for part in re_split(r'[\W]', date_string)[:3]
))
except ValueError:
return None, date_string
return date_string

return date_object, date_object.strftime(date_format)
return date_object.strftime(date_format)


def localize_time(time):
Expand Down

0 comments on commit ce5ae8d

Please sign in to comment.