Commits

David Butler  committed 3fc8ddd

Fixed regular expression to allow non plural number of days

  • Participants
  • Parent commits 02be996

Comments (0)

Files changed (1)

File timedelta/helpers.py

     datetime.timedelta(2)
     """
     # This is the format we sometimes get from Postgres.
-    d = re.match(r'((?P<days>\d+) days )?(?P<hours>\d+):'
+    d = re.match(r'((?P<days>\d+) days? )?(?P<hours>\d+):'
                  r'(?P<minutes>\d+)(:(?P<seconds>\d+))?',
                  unicode(string))
     if d: