new 'o' feature for date format strings.

svn: r16951
This commit is contained in:
Craig J. Anderson 2011-03-27 21:14:53 +00:00
parent 9b1cb8eecb
commit 4ee9e82163

View File

@ -232,6 +232,7 @@ class DateFormat(GenericFormat):
tmp = "000" + year
return tmp[-4:]
def month(char_found = "m"):
""" The month part only """
month = unicode(date.get_month())
@ -267,9 +268,19 @@ class DateFormat(GenericFormat):
return tmp[-2:]
code = "ymdM"
def modifier():
print "hi"
ui_mods = [_(""), _("before"), _("after"), _("about"),
_(""), _(""), _("")]
return ui_mods[date.get_modifier()].capitalize()
def modifier_up():
return modifier.upper()
code = "ymdMoO"
upper = ""
function = [year, month, day, month_up]
function = [year, month, day, month_up, modifier, modifier_up]
return self.generic_format(date, code, upper, function)