Skip to main content

Django date range form field

Project description

# django-bootstrap3-daterangepicker

This is django field wrapper for . Useful for reporting services.

Field data format is tuple (start_date, end_date).


1. ```pip install django_bootstrap3_daterangepicker```
2. add `'django_bootstrap3_daterangepicker'` to `INSTALLED_APPS`

* jQuery, Bootstrap are required on target page

class PeriodFilter(forms.Form):
range = DateRangeField(widget=DateRangeWidget(picker_options={
'ranges': common_dates()

# ...
form = PeriodFilter(initial={'range': (,})
# ...
(from_date, to_date) = form.cleaned_data['range']

Template - don't forget media:
{% block extracss %}
{{['css'] }}
{% endblock %}
{% block endscripts %}
{{ super() }}
{{['js'] }}
{% endblock %}

{% block content %}
{{ filter.range }}
{% endblock %}

Special thanks to for guidance in creating custom fields.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django_bootstrap3_daterangepicker, version 1.0.0b5
Filename, size & hash File type Python version Upload date (59.0 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page