[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - contents.py:1.16

Stephan Richter srichter@cbu.edu
Sat, 19 Apr 2003 17:27:47 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv4854/src/zope/app/browser/container

Modified Files:
	contents.py 
Log Message:
Internationalized modified and created date representation in 
contents.html.


=== Zope3/src/zope/app/browser/container/contents.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.15	Sun Mar 30 12:28:31 2003
+++ Zope3/src/zope/app/browser/container/contents.py	Sat Apr 19 17:27:16 2003
@@ -55,13 +55,14 @@
             if title:
                 info['title'] = title
 
+            formatter = self.request.locale.getDateFormatter('medium')
             created = dc.created
             if created is not None:
-                info['created'] = formatTime(created)
+                info['created'] = formatter.format(created)
 
             modified = dc.modified
             if modified is not None:
-                info['modified'] = formatTime(modified)
+                info['modified'] = formatter.format(modified)
 
         sized_adapter = queryAdapter(obj, ISized)
         if sized_adapter is not None:
@@ -179,16 +180,3 @@
 
     def index(self):
         return self._index()
-
-
-
-# XXX L10N Below is prime material for localization.
-# We are a touchpoint that should contact the personalization
-# service so that users can see datetime and decimals
-
-def formatTime(in_date):
-    format='%m/%d/%Y'
-    undefined=u'N/A'
-    if hasattr(in_date, 'strftime'):
-        return in_date.strftime(format)
-    return undefined