##// END OF EJS Templates
templatefilters: store the agescales in reverseorder directly
Benoit Boissinot -
r10601:b98b6a73 default
parent child Browse files
Show More
@@ -14,15 +14,13 b' def stringify(thing):'
14 return "".join([stringify(t) for t in thing if t is not None])
14 return "".join([stringify(t) for t in thing if t is not None])
15 return str(thing)
15 return str(thing)
16
16
17 agescales = [("second", 1),
17 agescales = [("year", 3600 * 24 * 365),
18 ("minute", 60),
18 ("month", 3600 * 24 * 30),
19 ("hour", 3600),
20 ("day", 3600 * 24),
21 ("week", 3600 * 24 * 7),
19 ("week", 3600 * 24 * 7),
22 ("month", 3600 * 24 * 30),
20 ("day", 3600 * 24),
23 ("year", 3600 * 24 * 365)]
21 ("hour", 3600),
24
22 ("minute", 60),
25 agescales.reverse()
23 ("second", 1),]
26
24
27 def age(date):
25 def age(date):
28 '''turn a (timestamp, tzoff) tuple into an age string.'''
26 '''turn a (timestamp, tzoff) tuple into an age string.'''
General Comments 0
You need to be logged in to leave comments. Login now