Bootstrap3/4 compatible datepicker for Django projects.
Project description
This package uses Bootstrap datepicker widget version 1.6.4.
Install
pip install git+https://github.com/pbucher/django-bootstrap-datepicker.git
ToDo
General cleanup and testing
Example
forms.py
from bootstrap_datepicker.widgets import DatePicker
from django import forms
class ToDoForm(forms.Form):
todo = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"}))
date = forms.DateField(
widget=DatePicker(options={"format": "mm/dd/yyyy","autoclose": True}))
The options will be passed to the JavaScript datepicker instance. Available options are explained in the following documents:
Online Docs (ReadTheDocs.com)
Checkout the online demo to help with exploring different options:
You don’t need to set the language option, because it will be set the current language of the thread automatically.
template.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="{% static 'contrib/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'contrib/font-awesome.min.css' %}">
<script src="{% static 'contrib/bootstrap.js' %}"></script>
</head>
<body>
<form method="post" role="form">
{{ form|bootstrap }}
{% csrf_token %}
<div class="form-group">
<input type="submit" value="Submit" class="btn btn-primary" />
</div>
</form>
</body>
</html>
Here we assume you’re using django-bootstrap-form or django-jinja-bootstrap-form but you can draw out your HTML manually.
Requirements
Python >= 3.3
Django >= 1.8
Bootstrap == 4.0-alpha4
jquery >= 1.7.1
font-awesome >= 4.5.X
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-bootstrap-datepicker-1.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8250600a60d13199767c5455783d4d4dad68758038c371c05f47d858f338c10d |
|
MD5 | cf491f2fde60f1923150fae2cb63a273 |
|
BLAKE2b-256 | 9671c364afc54e901c037f38f62a84713eae70dec7ed459825ae51c53d729e76 |
Hashes for django_bootstrap_datepicker-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3090afe5a6157ecccb343d0036f3fef343712cb633d807331e8a6f590359e8d5 |
|
MD5 | 53fedf465440060c2d8ad862c734b362 |
|
BLAKE2b-256 | d32b17ac6614d5f91c3d7ed5a7487af1ba9ed786696da0780c7052bedb2db419 |