diff --git a/src/tools/common/template.py b/src/tools/common/template.py index b3aec1e5..8d02a182 100644 --- a/src/tools/common/template.py +++ b/src/tools/common/template.py @@ -195,7 +195,7 @@ class Renderer(object): # custom filters self.env.filters['next_gidx'] = self._next_gidx self.env.filters['cur_gidx'] = self._cur_gidx - self.env.filters['blog_date'] = self._blog_date + self.env.filters['date_days'] = self._date_days def installTranslations(self): i18n_dir = os.path.join(self.base_dir, 'i18n') @@ -319,9 +319,8 @@ class Renderer(object): """Use current current global index as suffix""" return u"{}_{}".format(value, ctx['gidx'].current()) - def _blog_date(self, timestamp): - # FIXME: Q&D, need to be done properly - return unicode(int(time.time() - int(timestamp))/(3600*24)) + u" days ago" + def _date_days(self, timestamp): + return int(time.time() - int(timestamp))/(3600*24) def render(self, template, theme=None, locale=DEFAULT_LOCALE, root_path=u'', css_files=None, css_inline=False, **kwargs): """render a template