[doc] Adds HowTo format date.
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Tue, 14 Apr 2009 17:18:00 -0700
changeset 1354 e71f704aaf40
parent 1353 fb5f014b861d
child 1355 8a3102fb4760
[doc] Adds HowTo format date.
doc/book/en/D010-faq.en.txt
--- a/doc/book/en/D010-faq.en.txt	Tue Apr 14 17:17:34 2009 -0700
+++ b/doc/book/en/D010-faq.en.txt	Tue Apr 14 17:18:00 2009 -0700
@@ -238,3 +238,13 @@
   This will yield additional WARNINGs, like this: ::
 
     2009-01-09 16:43:52 - (cubicweb.selectors) WARNING: selector one_line_rset returned 0 for <class 'cubicweb.web.views.basecomponents.WFHistoryVComponent'>
+
+* How to format an entity date attribute?
+
+  If your schema has an attribute of type Date or Datetime, you might
+  want to format it. First, you should define your preferred format using
+  the site configuration panel ``http://appurl/view?vid=systemepropertiesform``
+  and then set ``ui.date`` and/or ``ui.datetime``.
+  Then in the view code, use::
+    
+    self.format_date(entity.date_attribute)