Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

This django widget contains Bootstrap 3, Bootstrap 4 and Bootstrap 5 Date-Picker, Time-Picker, DateTime-Picker, Month-Picker and Year-Picker input with date-range-picker functionality for django version >= 2.0. The widget implements bootstrap-datetimepicker v4 to show bootstrap-datepicker in django model forms and custom forms which can be configured easily for date-range selection.

If you are not using Bootstrap use django-flatpickr instead. If you are pinned to an older Django version < 2.0, use v3.x instead.

Build Status Documentation Status Coverage Status Typed Downloads
Python Versions DJango Versions Licence
Date-picker Datetime-picker Time-picker

Demo

Getting Started

Usage

Usage in Generic View

# File: views.py
from bootstrap_datepicker_plus.widgets import DateTimePickerInput
from django.views import generic
from .models import Question

class CreateView(generic.edit.CreateView):
    model = Question
    fields = ["question_text", "pub_date"]
    def get_form(self, form_class=None):
        form = super().get_form(form_class)
        form.fields["pub_date"].widget = DateTimePickerInput()
        return form

Advanced Usage

Types of DatePickers

The widget contains all types of date-picker you may ever need.

# File: forms.py
from bootstrap_datepicker_plus.widgets import DatePickerInput, TimePickerInput, DateTimePickerInput, MonthPickerInput, YearPickerInput
from django import forms

class EventForm(forms.ModelForm):
    class Meta:
        model = Event
        fields = ["start_date", "start_time", "start_datetime", "start_month", "start_year"]
        widgets = {
            "start_date": DatePickerInput(),
            "start_time": TimePickerInput(),
            "start_datetime": DateTimePickerInput(),
            "start_month": MonthPickerInput(),
            "start_year": YearPickerInput(),
        }

Implement date-range-picker

DatePickers can be linked to select a date-range or time-range.

# File: forms.py
from bootstrap_datepicker_plus.widgets import DatePickerInput, TimePickerInput
from django import forms

class EventForm(forms.ModelForm):
    class Meta:
        model = Event
        fields = ["name", "start_date", "end_date", "start_time", "end_time"]
        widgets = {
            "start_date": DatePickerInput(),
            "end_date": DatePickerInput(range_from="start_date"),
            "start_time": TimePickerInput(),
            "end_time": TimePickerInput(range_from="start_time"),
        }

Customization

Contributing

License

This project is licensed under MIT LICENSE file for details.

Acknowledgments

This project implements Eonasdan/bootstrap-datetimepicker to display date-pickers. The project was initially forked from pbucher/django-bootstrap-datepicker and later reworked completely under MIT Licence.

Buy Me A Coffee

Download files

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

Source Distribution

django_bootstrap_datepicker_plus-7.0.0rc0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_bootstrap_datepicker_plus-7.0.0rc0.tar.gz.

File metadata

File hashes

Hashes for django_bootstrap_datepicker_plus-7.0.0rc0.tar.gz
Algorithm Hash digest
SHA256 47e521084bd301330e0d49bfef36a1bdb81612510151faea9fca99cc383488a2
MD5 d38eed9244558044f7b68fde78a40974
BLAKE2b-256 12b4335f568664f9bd34838d78f4a96aa953ab4a841f2814edc7bf35726c87cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_bootstrap_datepicker_plus-7.0.0rc0.tar.gz:

Publisher: deploy.yml on monim67/django-bootstrap-datepicker-plus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_bootstrap_datepicker_plus-7.0.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_bootstrap_datepicker_plus-7.0.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 32d6472ec9c1c02b797659761a50ae249f2b8d77066b76119f21c2f3c35491a8
MD5 0903b386961dcfcb50169c158ef4e707
BLAKE2b-256 68a12ea97bd9690062f3eb2ff5ca97b085edb6f560542a55f52c536ca759d983

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_bootstrap_datepicker_plus-7.0.0rc0-py3-none-any.whl:

Publisher: deploy.yml on monim67/django-bootstrap-datepicker-plus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

7.0.0rc0 This release

2 files

6.0.0

2 files

5.0.6

2 files

5.0.5

2 files

5.0.4

2 files

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

4.0.0

2 files

3.0.6

2 files

3.0.5

2 files

3.0.4

2 files

2.0.0

2 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