Commit 70345deb authored by Jérome Perrin's avatar Jérome Perrin

DateTimePatch: document _parse patch and make it support DateTime 4

parent 5b6d4788
...@@ -70,6 +70,13 @@ def DateTime__getstate__(self): ...@@ -70,6 +70,13 @@ def DateTime__getstate__(self):
DateTimeKlass.__getstate__ = DateTime__getstate__ DateTimeKlass.__getstate__ = DateTime__getstate__
# ERP5 Patch to have different parsing rules.
# We have a patch since e0eba4791a (Authorised date manipulation before
# year 1000, 2008-01-28), which replaced the method with an implementation
# that did not change since, so we don't have new behaviors of DateTime
# the most visible change might be that we don't have "timezone naive"
# support.
def DateTime_parse(self, st, datefmt=getDefaultDateFormat()): def DateTime_parse(self, st, datefmt=getDefaultDateFormat()):
# Parse date-time components from a string # Parse date-time components from a string
month=year=tz=tm=None month=year=tz=tm=None
...@@ -92,6 +99,9 @@ def DateTime_parse(self, st, datefmt=getDefaultDateFormat()): ...@@ -92,6 +99,9 @@ def DateTime_parse(self, st, datefmt=getDefaultDateFormat()):
else: tz = None # Decide later, since the default time zone else: tz = None # Decide later, since the default time zone
# could depend on the date. # could depend on the date.
# XXX we don't support timezone naive in this patch
self._timezone_naive = False
ints,dels=[],[] ints,dels=[],[]
i,l=0,len(st) i,l=0,len(st)
while i < l: while i < l:
......
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