new 'o' feature for date format strings.
svn: r16950
This commit is contained in:
parent
0204ee48e4
commit
92cf3a2901
@ -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,16 @@ class DateFormat(GenericFormat):
|
||||
return tmp[-2:]
|
||||
|
||||
|
||||
code = "ymdM"
|
||||
upper = ""
|
||||
function = [year, month, day, month_up]
|
||||
def modifier():
|
||||
#ui_mods taken from date.py def lookup_modifier(self, modifier):
|
||||
ui_mods = ["", _("before"), _("after"), _("about"),
|
||||
"", "", ""]
|
||||
return ui_mods[date.get_modifier()].capitalize()
|
||||
|
||||
|
||||
code = "ymdMo"
|
||||
upper = "O"
|
||||
function = [year, month, day, month_up, modifier]
|
||||
|
||||
return self.generic_format(date, code, upper, function)
|
||||
|
||||
@ -1447,4 +1455,3 @@ if __name__ == '__main__':
|
||||
34, 35, 38, 39, 38, 33, 32, 33, 36, 37, 36, 40, 41, 40, 44, 33, 32, 33,
|
||||
36, 37, 36, 40, 41, 40, 44, 38, 39, 38, 42, 46] else "!! bad !!"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user