web/widgets.py
changeset 488 2984b3ec7034
parent 62 ef06f71533d9
child 849 8591d896db7e
child 1190 15fc369bc3ca
--- a/web/widgets.py	Tue Jan 27 19:12:37 2009 +0100
+++ b/web/widgets.py	Tue Jan 27 19:13:54 2009 +0100
@@ -732,12 +732,13 @@
         formatstr = req.property_value(self.format_key)
         return now().strftime(formatstr)
 
-    def add_localized_infos(self, req):
+    @classmethod
+    def add_localized_infos(cls, req):
         """inserts JS variables defining localized months and days"""
         # import here to avoid dependancy from cubicweb-common to simplejson
         _ = req._
-        monthnames = [_(mname) for mname in self.monthnames]
-        daynames = [_(dname) for dname in self.daynames]
+        monthnames = [_(mname) for mname in cls.monthnames]
+        daynames = [_(dname) for dname in cls.daynames]
         req.html_headers.define_var('MONTHNAMES', monthnames)
         req.html_headers.define_var('DAYNAMES', daynames)