From 2f042e2dc4e94d09a961bb54b608e48f25a4c5c8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 25 Jun 2024 11:17:25 +0200 Subject: 🐛 Forms: fix date validation not possible when switching to english (refs #5837) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views_item.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ishtar_common/views_item.py') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index f6d61cc1a..6f99ba7a2 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1098,7 +1098,14 @@ def _manage_date(k, dct): "%Y-%m-%d" ))) except ValueError: - pass + try: + # try US format + results.append(( + date_type, + datetime.datetime(*map(lambda x: int(x), reversed(items))).strftime("%Y-%m-%d") + )) + except ValueError: + pass mins = [value for dt, value in results if dt == "gte"] maxs = [value for dt, value in results if dt == "lte"] eqs = [value for dt, value in results if dt == "eq"] -- cgit v1.2.3