mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-06-22 02:33:41 +02:00
added utils function for regional date, use for scheduler notifications as well
This commit is contained in:
@ -428,7 +428,7 @@ class XbmcBackup:
|
||||
date_time = datetime(int(dirName[0:4]),int(dirName[4:6]),int(dirName[6:8]),int(dirName[8:10]),int(dirName[10:12]))
|
||||
|
||||
#format the string based on region settings
|
||||
result = "%s %s" % (date_time.strftime(xbmc.getRegion('dateshort')),date_time.strftime(xbmc.getRegion('time')))
|
||||
result = utils.getRegionalTimestamp(date_time, ['dateshort','time'])
|
||||
|
||||
return result
|
||||
|
||||
|
@ -29,6 +29,14 @@ def setSetting(name,value):
|
||||
def getString(string_id):
|
||||
return __Addon.getLocalizedString(string_id)
|
||||
|
||||
def getRegionalTimestamp(date_time,dateformat=['dateshort']):
|
||||
result = ''
|
||||
|
||||
for aFormat in dateformat:
|
||||
result = result + ("%s " % date_time.strftime(xbmc.getRegion(aFormat)))
|
||||
|
||||
return result.strip()
|
||||
|
||||
def encode(string):
|
||||
result = ''
|
||||
|
||||
|
Reference in New Issue
Block a user