Skip to main content

Flask-Datepicker

Latest Release Coverage Percentage
Supported versions

A Flask extension for jQueryUI DatePicker, it makes adding and customizing multiple date pickers simpler and less time consuming.

Install:

- With pip

  • pip install Flask-Datepicker

- From the source:

  • git clone https://github.com/mrf345/flask_datepicker.git
  • cd flask_datepicker
  • python setup.py install

Setup:

- Inside Flask app:

from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_datepicker import Datepicker

app = Flask(__name__)
Bootstrap(app)
datepicker = Datepicker(app)

- Inside jinja template:

{% extends 'bootstrap/base.html' %}
{% block scripts %}
  {{ super() }}
  {{ datepicker.loader() }} {# to load jQuery-ui #}
  {{ datepicker.picker(id=".dp") }}
{% endblock %}
{% block content %}
  <form class="verticalform">
    <input type="text" class="form-control dp" />
  </form>
{% endblock %}

Settings:

- Options:

the accepted arguments to be passed to the datepicker.picker():

def picker(id=".datepicker", # identifier will be passed to Jquery to select element
           dateFormat='yy-mm-dd', # can't be explained more !
           maxDate='2018-12-30', # maximum date to select from. Make sure to follow the same format yy-mm-dd
           minDate='2017-12-01', # minimum date
           btnsId='.btnId' # id assigned to instigating buttons if needed
): 
- Themes

datepicker.loader() allows you to select a specific theme of your choice via:

datepicker.loader(theme="base")

If there is not a theme selected, the extension will select a new random theme with each reload of the page to be used. To make it remember the random choice, pass :

datepicker.loader(random_remember=True)

List of available themes :
['base', 'black-tie', 'blitzer' 'cupertino','dark-hive', 'dot-luv', 'eggplant', 'excite-bike', 'flick', 'hot-sneaks', 'humanity', 'le-frog','mint-choc', 'overcast', 'pepper-grinder', 'redmond','smoothness', 'south-street', 'start', 'sunny','swanky-purse', 'trontastic', 'ui-darkness','ui-lightness', 'vader']

- Local source:

by default the extension will load jQueryUI plugin from a remote CDN. Although you can configure that to be locally through passing a list of two files .js and .css into the datepicker module like such:

datepicker(app=app, local=['static/js/jquery-ui.js', 'static/css/jquery-ui.css'])

Credit:

Download files

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

Source Distribution

flask_datepicker-0.16.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

Flask_Datepicker-0.16-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file flask_datepicker-0.16.tar.gz.

File metadata

  • Download URL: flask_datepicker-0.16.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for flask_datepicker-0.16.tar.gz
Algorithm Hash digest
SHA256 f3058c33baf16bd42e7051107cd896a5bd6b97904e690ccf4267f71c32971dc8
MD5 f79e18b2fa006d08a0eae6a3be8e5530
BLAKE2b-256 3908f67ed10eec314ca9b88c5c2ffea0503ab3d7eb3fce7bf9650d5cf0a3d23c

See more details on using hashes here.

File details

Details for the file Flask_Datepicker-0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Datepicker-0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 28623a5db52d4f15166a59c2aaeb9f206017ea7f4ebb1b02e017d927250169f0
MD5 73b8b3b28960ad38c85a44adbab063dd
BLAKE2b-256 c7e209223121c8aa9fb03314e00ca81f5e1eaa31f4a80e768e38415eab9ad163

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.16 This release

2 files

0.15

2 files

0.14

2 files

0.13

2 files

0.12

1 file

0.11

1 file

0.10

1 file

0.9

1 file

0.8

1 file

0.6

1 file

0.5

1 file

0.4

1 file

0.3

1 file

0.2

1 file

0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page