From 8d42ba0276993ad7753ea89e502c40c17908e778 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Fri, 28 Oct 2022 13:03:30 -0400 Subject: [PATCH] date time field accepts partial ISO8061 format. this is a work around, should be changed once django version has been updated. #209 is tracking this --- python/gui/MaaS/cbv/DatasetManagementForms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/gui/MaaS/cbv/DatasetManagementForms.py b/python/gui/MaaS/cbv/DatasetManagementForms.py index 5b46195da..d89257b53 100644 --- a/python/gui/MaaS/cbv/DatasetManagementForms.py +++ b/python/gui/MaaS/cbv/DatasetManagementForms.py @@ -11,7 +11,9 @@ # correspond to `dmod.core.meta_data.StandardDatasetIndex`` _Unknown = forms.CharField _Time = partial( - forms.DateTimeField, widget=forms.DateInput(attrs={"type": "datetime-local"}) + forms.DateTimeField, widget=forms.DateTimeInput(attrs={"type": "datetime-local"}), + # TODO: this should be removed once we upgrade django versions >= 3.1 (tracked by #209) + input_formats=["%Y-%m-%dT%H:%M"] ) _CatchmentId = forms.CharField _DataId = forms.CharField