1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-05 17:05:03 -05:00

Merge pull request #505 from Prinz23/datetime_fix2

Datetime fix2, fixes #381
This commit is contained in:
Nils 2014-05-10 14:05:35 +02:00
commit 41670969ec

View File

@ -99,6 +99,11 @@ class sbdatetime(datetime.datetime):
@static_or_instance
def sbftime(self, dt=None, show_seconds=False, t_preset=None):
try:
locale.setlocale(locale.LC_TIME, '')
except:
pass
try:
if sbdatetime.has_locale:
locale.setlocale(locale.LC_TIME, 'us_US')
@ -133,6 +138,11 @@ class sbdatetime(datetime.datetime):
@static_or_instance
def sbfdate(self, dt=None, d_preset=None):
try:
locale.setlocale(locale.LC_TIME, '')
except:
pass
strd = ''
try:
if self is None:
@ -153,6 +163,11 @@ class sbdatetime(datetime.datetime):
@static_or_instance
def sbfdatetime(self, dt=None, show_seconds=False, d_preset=None, t_preset=None):
try:
locale.setlocale(locale.LC_TIME, '')
except:
pass
strd = ''
try:
if self is None: