Commits

Kevin Wetzels committed e4b9a07

Fix error in MinutesWidget rendering 60 as 0:60 instead of 1:00

Comments (0)

Files changed (3)

 
 setup(
     name='django-stdfields',
-    version='0.0.10',
+    version='1.0.0',
     author=u'Kevin Wetzels',
     author_email=u'kevin@roam.be',
     url='https://bitbucket.org/roam/django-stdfields',

stdfields/tests.py

         tpl = '<input type="text" name="hi" value="%s" />'
         self.assertEqual(w.render('hi', '121'), tpl % '2:01')
         self.assertEqual(w.render('hi', '2:1'), tpl % '2:1')
+        self.assertEqual(w.render('hi', 60), tpl % '1:00')
         self.assertEqual(w.render('hi', '2:60'), tpl % '2:60')
         self.assertEqual(w.render('hi', '493'), tpl % '8:13')
 

stdfields/widgets.py

     def divide(cls, total):
         if total <= 0:
             return (0, 0)
-        hours = 0 if total <= 60 else total / 60
+        hours = 0 if total < 60 else total / 60
         return (hours, total - (hours * 60))