Skip to main content

django-bootstrap-daterangepicker

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 datetime.date 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.

Origin

This is unofficial package. No changes except issue#23.

Installation

  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(
        input_formats=['%d/%m/%Y'],
        widget=widgets.DatePickerWidget(
            format='%d/%m/%Y'
        )
    )
    date_single_clearable = fields.DateField(required=False)

    # Date Range Fields
    date_range_normal = fields.DateRangeField()
    date_range_with_format = fields.DateRangeField(
        input_formats=['%d/%m/%Y'],
        widget=widgets.DateRangeWidget(
            format='%d/%m/%Y'
        )
    )
    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)'],
        widget=widgets.DateTimeRangeWidget(
            format='%d/%m/%Y (%I:%M:%S)'
        )
    )
    datetime_range_clearable = fields.DateTimeRangeField(required=False)

Requirements

Metadata

Release files for django4-bootstrap-daterangepicker 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django4-bootstrap-daterangepicker 1.0.7
File Size Uploaded
django4-bootstrap-daterangepicker-1.0.7.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django4-bootstrap-daterangepicker 1.0.7
File Interpreter ABI Platform
django4_bootstrap_daterangepicker-1.0.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.2 kB

Release files / django4-bootstrap-daterangepicker-1.0.7.tar.gz

Download URL django4-bootstrap-daterangepicker-1.0.7.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
74fdb02e877d818a0a220bd510ce09185fc229d6f578828558f102c6cd1b8682
BLAKE2b-256 checksum
How to use checksums
23e6bdf2dcd9effbc384a1f39a5b4d6d12eca70521ddd6bdb2059aedcdd95653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / django4_bootstrap_daterangepicker-1.0.7-py2.py3-none-any.whl

Download URL django4_bootstrap_daterangepicker-1.0.7-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
59e0b3c556165d63cf9ecd9569285feb459be4b18ac662d0700da2ace8a9d274
BLAKE2b-256 checksum
How to use checksums
c6fcfdd0b10e173e77095233d5e6b5fdc06b3932d2b0d3b2dc387fda9c2c5fe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page