Added decades and centuries

Will need slightly different logic for different naming conventions.
This commit is contained in:
thenoodle68 2013-11-30 19:33:12 +08:00
parent f55c8f8d4e
commit cdf8922f4d

View file

@ -20,6 +20,8 @@ def plural(num=0, text=''):
def format_time(seconds, accuracy=3, simple=False): def format_time(seconds, accuracy=3, simple=False):
if simple: if simple:
periods = [ periods = [
('c', 60*60*24*365*100),
('de', 60*60*24*365*10),
('y', 60*60*24*365), ('y', 60*60*24*365),
('m', 60*60*24*30), ('m', 60*60*24*30),
('d', 60*60*24), ('d', 60*60*24),
@ -29,6 +31,8 @@ def format_time(seconds, accuracy=3, simple=False):
] ]
else: else:
periods = [ periods = [
('century ', 60*60*24*365*100),
('decade', 60*60*24*365*10),
(' year', 60*60*24*365), (' year', 60*60*24*365),
(' month', 60*60*24*30), (' month', 60*60*24*30),
(' day', 60*60*24), (' day', 60*60*24),