##// END OF EJS Templates
add iso date template filter.
Vadim Gelfer -
r1906:9dec2479 default
parent child Browse files
Show More
@@ -144,6 +144,9 b' def age(x):'
144 if n >= 2 or s == 1:
144 if n >= 2 or s == 1:
145 return fmt(t, n)
145 return fmt(t, n)
146
146
147 def isodate(date):
148 return util.datestr(date, format='%Y-%m-%d %H:%M')
149
147 def nl2br(text):
150 def nl2br(text):
148 return text.replace('\n', '<br/>\n')
151 return text.replace('\n', '<br/>\n')
149
152
@@ -170,6 +173,7 b' common_filters = {'
170 "domain": domain,
173 "domain": domain,
171 "escape": lambda x: cgi.escape(x, True),
174 "escape": lambda x: cgi.escape(x, True),
172 "firstline": (lambda x: x.splitlines(1)[0]),
175 "firstline": (lambda x: x.splitlines(1)[0]),
176 "isodate": isodate,
173 "obfuscate": obfuscate,
177 "obfuscate": obfuscate,
174 "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"),
178 "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"),
175 "person": person,
179 "person": person,
General Comments 0
You need to be logged in to leave comments. Login now