Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Bootstrap3 compatible datetimepicker for Django projects.

Project Description

This package uses Bootstrap v3 datetimepicker widget version 4.

This project was originally a fork of https://github.com/nkunihiko/django-bootstrap3-datetimepicker, it how has the following breaking changes:

  • js/css files are no longer included in the project, managing them is up to the user, eg. using grablib.
  • the widget no longer has js/css assets. these are left for you to deploy as you wish.
  • bug/warning fixes
  • remove support for python 2.6 and associated clean up

Install

pip install django-bootstrap3-datetimepicker-2

Example

forms.py

from bootstrap3_datetime.widgets import DateTimePicker
from django import forms

  class ToDoForm(forms.Form):
      todo = forms.CharField(
          widget=forms.TextInput(attrs={"class": "form-control"}))
      date = forms.DateField(
          widget=DateTimePicker(options={"format": "YYYY-MM-DD",
                                         "pickTime": False}))
      reminder = forms.DateTimeField(
          required=False,
          widget=DateTimePicker(options={"format": "YYYY-MM-DD HH:mm",
                                         "pickSeconds": False}))

The options will be passed to the JavaScript datetimepicker instance. Available options are explained in the following documents:

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>
    <!-- load all required js/css yourself here -->
  </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 >= 2.7
  • Django >= 1.8
  • Bootstrap == 3.X
  • Moment >= 2.10.6
  • bootstrap-datetimepicker >= 4.15.35
Release History

Release History

This version
History Node

2.4.2

History Node

2.4.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-bootstrap3-datetimepicker-2-2.4.2.tar.gz (3.6 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting