# HG changeset patch # User Sandrine Ribeau # Date 1239754680 25200 # Node ID e71f704aaf407e94b21093be357ad4497ae93326 # Parent fb5f014b861d387563f2e518815e4f2939920c3f [doc] Adds HowTo format date. diff -r fb5f014b861d -r e71f704aaf40 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 + +* 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)