diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-13 17:21:05 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-13 17:21:05 +0200 | 
| commit | 786b4136f1e0740259260fa61dd389db5f8109b9 (patch) | |
| tree | 63a2789309572ae9cd9bbdb11703a188240031b6 | |
| parent | 955245a7083c2b3e00daba667d541ab1785603ce (diff) | |
| download | Ishtar-786b4136f1e0740259260fa61dd389db5f8109b9.tar.bz2 Ishtar-786b4136f1e0740259260fa61dd389db5f8109b9.zip  | |
Manage date before 1900 on search
| -rw-r--r-- | ishtar_common/views_item.py | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 98415c311..a6bf7e190 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -4,6 +4,7 @@  from copy import copy, deepcopy  import csv  import datetime +import virtualtime  import json  import logging  import re @@ -490,8 +491,8 @@ def _manage_dated_fields(dated_fields, dct):              try:                  items = dct[k].replace('"', '').split('/')                  assert len(items) == 3 -                dct[k] = datetime.date(*map(lambda x: int(x), -                                            reversed(items))) \ +                dct[k] = virtualtime.datetime(*map(lambda x: int(x), +                                              reversed(items))) \                      .strftime('%Y-%m-%d')              except AssertionError:                  dct.pop(k)  | 
