From dd9a836a66e07145e52a5e74a158617609c155df Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 21 Jan 2018 11:18:58 -0500 Subject: [PATCH] Fix saving eents using the new datepicker widget --- events/forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/events/forms.py b/events/forms.py index 0259394..94aafc6 100644 --- a/events/forms.py +++ b/events/forms.py @@ -7,6 +7,7 @@ from .models.profiles import Team from .models.events import Event, Place from datetime import time +from time import strptime, strftime class LookupMedia(Media): def render(self): @@ -136,6 +137,10 @@ class DateTimeWidget(SplitDateTimeWidget): def format_output(self, rendered_widgets): return '%s %s' % (rendered_widgets[0], rendered_widgets[1]) + def value_from_datadict(self, data, files, name): + values = super(DateTimeWidget, self).value_from_datadict(data, files, name) + return ' '.join(values) + class TeamForm(ModelForm): class Meta: model = Team