diff --git a/RIGS/finance.py b/RIGS/finance.py index 87764189..2c9f21c0 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -15,6 +15,9 @@ from z3c.rml import rml2pdf from RIGS import models +from django import forms +forms.DateField.widget = forms.DateInput(attrs={'type': 'date'}) + class InvoiceIndex(generic.ListView): model = models.Invoice diff --git a/RIGS/forms.py b/RIGS/forms.py index d1b826c3..e0d57f70 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -10,6 +10,10 @@ import simplejson from RIGS import models +# Override the django form defaults to use the HTML date/time/datetime UI elements +forms.DateField.widget = forms.DateInput(attrs={'type': 'date'}) +forms.TimeField.widget = forms.DateInput(attrs={'type': 'time'}) +forms.DateTimeField.widget = forms.DateInput(attrs={'type': 'datetime-local'}) # Registration class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail): diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index b2b4dcd7..6832d571 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -289,10 +289,10 @@