mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-04 16:44:11 +01:00
utils.time: Add support for timezones without a slash.
eg. UTC, CET, ...
This commit is contained in:
parent
ed9dffdd7f
commit
e223b507dd
@ -96,6 +96,7 @@ class TimeTestCase(PluginTestCase):
|
|||||||
def testTztime(self):
|
def testTztime(self):
|
||||||
self.assertNotError('tztime Europe/Paris')
|
self.assertNotError('tztime Europe/Paris')
|
||||||
self.assertNotError('tztime America/Indiana/Knox')
|
self.assertNotError('tztime America/Indiana/Knox')
|
||||||
|
self.assertNotError('tztime UTC')
|
||||||
self.assertError('tztime Europe/Gniarf')
|
self.assertError('tztime Europe/Gniarf')
|
||||||
|
|
||||||
@skipIf(not has_dateutil, 'python-dateutil is missing')
|
@skipIf(not has_dateutil, 'python-dateutil is missing')
|
||||||
|
@ -41,7 +41,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pytz = None
|
pytz = None
|
||||||
|
|
||||||
_IANA_TZ_RE = re.compile("([\w_-]+/)+[\w_-]+")
|
_IANA_TZ_RE = re.compile("([\w_-]+/)*[\w_-]+")
|
||||||
|
|
||||||
class TimezoneException(Exception):
|
class TimezoneException(Exception):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user