
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
pip install Flask-Datepicker
git clone https://github.com/mrf345/flask_datepicker.git
cd flask_datepicker
python setup.py install
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_datepicker import Datepicker
app = Flask(__name__)
Bootstrap(app)
datepicker = Datepicker(app)
{% 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 %}
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
):
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']
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'])
- Datepicker: jQuery-ui date picker.
FAQs
A Flask extension for jQueryUI DatePicker.
We found that Flask-Datepicker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.