sql: fix serialization of dates with 2-digits years (#56205)
This commit is contained in:
parent
16a91507d4
commit
e869dbb01c
|
@ -116,7 +116,7 @@ class Criteria(qommon.storage.Criteria):
|
|||
|
||||
def as_sql_param(self):
|
||||
if isinstance(self.value, datetime.date):
|
||||
value = self.value.strftime('%Y-%m-%d')
|
||||
value = self.value.strftime('%4Y-%m-%d')
|
||||
elif isinstance(self.value, time.struct_time):
|
||||
value = datetime.datetime.fromtimestamp(time.mktime(self.value))
|
||||
else:
|
||||
|
@ -1750,7 +1750,7 @@ class SqlMixin:
|
|||
for entry in value.get('data') or []:
|
||||
subvalue = entry.get(field_id)
|
||||
if subvalue and field_type == 'date':
|
||||
entry[field_id] = strftime('%Y-%m-%d', subvalue)
|
||||
entry[field_id] = strftime('%4Y-%m-%d', subvalue)
|
||||
elif subvalue and field_type == 'file':
|
||||
entry[field_id] = subvalue.__getstate__()
|
||||
elif sql_type == 'boolean':
|
||||
|
|
Loading…
Reference in New Issue