Commit c2d2c8ec authored by Andreas Jung's avatar Andreas Jung

-added test/fix for international dates in format DD/MM/YYYY

parent 42694d94
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Encapsulation of date/time values""" """Encapsulation of date/time values"""
__version__='$Revision: 1.85 $'[11:-2] __version__='$Revision: 1.86 $'[11:-2]
import os, re, math, DateTimeZone import os, re, math, DateTimeZone
...@@ -960,7 +960,7 @@ class DateTime: ...@@ -960,7 +960,7 @@ class DateTime:
raise self.SyntaxError, st raise self.SyntaxError, st
day=None day=None
if ints[-1] > 60 and d not in ['.',':'] and len(ints) > 2: if ints[-1] > 60 and d not in ['.',':','/'] and len(ints) > 2:
year=ints[-1] year=ints[-1]
del ints[-1] del ints[-1]
if month: if month:
......
...@@ -317,6 +317,8 @@ class DateTimeTests(unittest.TestCase): ...@@ -317,6 +317,8 @@ class DateTimeTests(unittest.TestCase):
d_int = DateTime("%d.%d.%d" % (day,month,year), datefmt="international") d_int = DateTime("%d.%d.%d" % (day,month,year), datefmt="international")
self.assertEqual(d_us, d_int) self.assertEqual(d_us, d_int)
d_int = DateTime("%d/%d/%d" % (day,month,year), datefmt="international")
self.assertEqual(d_us, d_int)
def test_suite(): def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment