Skip to main content

A Django form field and widget wrapper for bootstrap-daterangepicker

Project description


This is Django form field wrapper for bootstrap-daterangepicker, for use with Bootstrap 3 and 4.

This module allows for: single date pickers, date range selectors and datetime range selectors.

Ranges are returned as tuples of format (start, end), where start and end are or datetime.datetime objects depending on the field type.

The DateField is a replacement for Django's built-in forms.DateField, with the only difference being that it accepts an optional clearable parameter, and the default widget is the DatePickerWidget specified in this module.


  1. pip install django-bootstrap-daterangepicker
  2. Add 'bootstrap_daterangepicker' to your INSTALLED_APPS
  3. Add the resource links required for bootstrap-daterangepicker into the <head> of the relevant HTML files

Example usage

from django import forms
from bootstrap_daterangepicker import widgets, fields

class DemoForm(forms.Form):
    # Date Picker Fields
    date_single_normal = fields.DateField()
    date_single_with_format = fields.DateField(
    date_single_clearable = fields.DateField(required=False)

    # Date Range Fields
    date_range_normal = fields.DateRangeField()
    date_range_with_format = fields.DateRangeField(
    date_range_clearable = fields.DateRangeField(required=False)

    # DateTime Range Fields
    datetime_range_normal = fields.DateTimeRangeField()
    datetime_range_with_format = fields.DateTimeRangeField(
        input_formats=['%d/%m/%Y (%I:%M:%S)'],
            format='%d/%m/%Y (%I:%M:%S)'
    datetime_range_clearable = fields.DateTimeRangeField(required=False)


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-bootstrap-daterangepicker, version 1.0.6
Filename, size File type Python version Upload date Hashes
Filename, size django_bootstrap_daterangepicker-1.0.6-py2.py3-none-any.whl (7.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-bootstrap-daterangepicker-1.0.6.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page