[req] fix format_time w/ 0:0 which is evaluated to False stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Jun 2010 13:56:52 +0200
branchstable
changeset 5710 1c17e47df974
parent 5709 5606c01d68b2
child 5711 ea2538a3c622
[req] fix format_time w/ 0:0 which is evaluated to False
req.py
--- a/req.py	Thu Jun 10 12:53:21 2010 +0200
+++ b/req.py	Thu Jun 10 13:56:52 2010 +0200
@@ -317,7 +317,7 @@
         """return a string for a date time according to instance's
         configuration
         """
-        if date:
+        if date is not None:
             if date_format is None:
                 if time:
                     date_format = self.property_value('ui.datetime-format')
@@ -330,7 +330,7 @@
         """return a string for a time according to instance's
         configuration
         """
-        if time:
+        if time is not None:
             return ustrftime(time, self.property_value('ui.time-format'))
         return u''