web/form.py
branchtls-sprint
changeset 1016 26387b836099
parent 1013 948a3882c94a
child 1031 1a89683cb687
--- a/web/form.py	Mon Mar 09 12:12:53 2009 +0100
+++ b/web/form.py	Tue Mar 10 11:35:52 2009 +0100
@@ -7,8 +7,9 @@
 __docformat__ = "restructuredtext en"
 
 from warnings import warn
+from datetime import date, datetime
+
 from simplejson import dumps
-from mx.DateTime import today, now
 
 from logilab.common.compat import any
 from logilab.mtconverter import html_escape
@@ -412,7 +413,7 @@
         inputid = form.context[field]['id']
         helperid = '%shelper' % inputid
         if not value:
-            value = today()
+            value = date.today()
         year, month = value.year, value.month
         onclick = "toggleCalendar('%s', '%s', %s, %s);" % (
             helperid, inputid, year, month)
@@ -643,7 +644,7 @@
         return value and ustrftime(value, req.property_value(self.format_prop)) or u''
 
     def render_example(self, req):
-        return self.format_value(req, now())
+        return self.format_value(req, datetime.now())
 
 
 class DateTimeField(DateField):