Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 487 Bytes
"""
This file is auto imported and patches any django widgets for htmlt5 support
"""
from django.forms.widgets import DateInput , DateTimeInput, TimeInput
from django.conf import settings
DateInput.input_type = 'date'
# If our project uses 'aware' timezones then we ought to use tiemzone enabled HTML5 input time or local otherwise
if settings.USE_TZ:
DateTimeInput.input_type = 'datetime'
else:
DateTimeInput.input_type = 'datetime-local'
TimeInput.input_type = 'time'
Something went wrong with that request. Please try again.