[ndtv] Add extractor (Fixes #1924)

This commit is contained in:
Philipp Hagemeister 2013-12-09 19:39:41 +01:00
parent 1e1f84dac9
commit caefb1de87
3 changed files with 79 additions and 0 deletions

View file

@ -1045,3 +1045,15 @@ def get_term_width():
except:
pass
return None
def month_by_name(name):
""" Return the number of a month by (locale-independently) English name """
ENGLISH_NAMES = [
u'Januar', u'February', u'March', u'April', u'May', u'June',
u'July', u'August', u'September', u'October', u'November', u'December']
try:
return ENGLISH_NAMES.index(name) + 1
except ValueError:
return None