try:
# check out the "N. poł X w." syntax
if isinstance(text, str): text = text.decode("utf-8")
try:
# check out the "N. poł X w." syntax
if isinstance(text, str): text = text.decode("utf-8")
century = roman_to_int(str(m.groups()[1]))
t = ((century*100 + (half-1)*50), 1, 1)
else:
century = roman_to_int(str(m.groups()[1]))
t = ((century*100 + (half-1)*50), 1, 1)
else:
return date(t[0], t[1], t[2])
except ValueError, e:
raise ValueError("Unrecognized date format. Try YYYY-MM-DD or YYYY.")
return date(t[0], t[1], t[2])
except ValueError, e:
raise ValueError("Unrecognized date format. Try YYYY-MM-DD or YYYY.")