Skip to main content

django-flatpickr

This django widget contains Date-Picker, Time-Picker, DateTime-Picker input widgets with date-range-picker functionality for django version >= 2.0. The widget implements flatpickr to display date-pickers in django model forms and custom forms which can be configured easily for date-range selection. For Bootstrap date-picker see django-bootstrap-datepicker-plus.

Build Status Coverage Status Python Versions DJango Versions

Flatpickr Red Theme Flatpickr Default Theme Flatpickr Dark Theme

Demo

Getting Started

Usage

Usage in Custom Form

# File: forms.py
from django_flatpickr.widgets import DatePickerInput, TimePickerInput, DateTimePickerInput
from .models import Event
from django import forms

class ToDoForm(forms.Form):
    todo = forms.CharField(widget=forms.TextInput())
    date = forms.DateField(widget=DatePickerInput())
    time = forms.TimeField(widget=TimePickerInput())
    datetime = forms.DateTimeField(widget=DateTimePickerInput())

Implement date-range-picker

DatePickers can be linked together to select a date-range, time-range or date-time-range without writing a single line of JavaScript.

# File: forms.py
from django_flatpickr.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"),
        }
  • Read the full Usage doc for django-filter, django-crispy-forms, dynamic formsets and modal examples.

Customization

Contributing

License

This project is licensed under the MIT LICENSE.

Download files

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

Source Distribution

django_flatpickr-2.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

django_flatpickr-2.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file django_flatpickr-2.1.0.tar.gz.

File metadata

  • Download URL: django_flatpickr-2.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_flatpickr-2.1.0.tar.gz
Algorithm Hash digest
SHA256 3cb3494502979b0d71e707563aeae5db766eed9fcd493614595ccdbdee471071
MD5 cbe32d2678472bbcadad439bf0df2e5e
BLAKE2b-256 d2669e028b8091144923c29296985ea6702fb51c886cab7c1e7af2e422bd8a8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_flatpickr-2.1.0.tar.gz:

Publisher: deploy.yml on monim67/django-flatpickr

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_flatpickr-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_flatpickr-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b21396a389023bec598778ce13026095b598ce8154e2eaf11932d693c7163e38
MD5 85d15af2942d2aefdbf0b52ed5ba9bae
BLAKE2b-256 5e2e4c485bb3342c1641899f59c1e500f826e7b0dcfa4b06126fc78671ae2fb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_flatpickr-2.1.0-py3-none-any.whl:

Publisher: deploy.yml on monim67/django-flatpickr

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

2.1.0 This release

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.0.1

2 files

1.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