A picker for dates and date ranges for multiple frameworks including Bootstrap 3, Bootstrap 4, and Material Design for Bootstrap 4.
npm install picker.js
$('input').datepicker({preset: 'bs3'})
$('input').datepicker({preset: 'bs4'})
$('input').datepicker({preset: 'bmd4'})
The datepicker is very configurable, including buttons, disabled dates or days of week, and much much more. Framework templates may override the Default
configuration to achieve specific behaviors, for example the BMD4Template uses CANCEL | OK
buttons, disables/skips the months view, and disables keyboard navigation so that all keypresses go directly to the input field.
With all of the options available, it's best to look directly at the Default
configuration for notes on how it works. You can also take a look at any of the tests in the config
directory.
Every single bit of date functionality is handled by the fantastic moment.js. See the moment.js documentation on formats for more information. A simple way to change the format is to pass in {format: 'valid momentjs format'}
to the constructor. See the format test for more.
Every single bit of UI placement functionality is handled by the fantastic popper.js. See the popper.js documentation
- An ES2015 base classes for use in multiple renderings for different frameworks
- Variations of
datepicker
:- Bootstrap 3 - completed
- Bootstrap 4 - works but could use some styling help
- bootstrap-material-design 4 picker that meets the Material Design specification - works - needs help on the animated reveal/hide
- (future) add time pickers - starting with material design
The bootstrap-datepicker project had 415 open issue and 64 open pull requests (at the time of writing). Aside from popularity, one reason for this is it bit off a big chunk, including all date functionality and rendering/placement functionality.
Maintaining that much code may be too much for anyone, and we want to expand it!
- Use ES2015 classes (available as es, iife or umd)
- Use SCSS for full variable based customization/inclusion
- Use moment.js for anything date related
- Use popper.js for anything UI placement related
- Created
presets
for rendering on different frameworks (BS3, BS4, BMD4)
- Install Gulp 4 -
npm install -g gulpjs/gulp-cli#4.0
- Install dependencies -
npm install
- Full build -
gulp
I usually have two terminals open, just to speed up everything during development builds:
gulp js:watch
or for speed without testsgulp js:dev:watch
gulp css:watch
Open the sandbox/index.html
or the sandbox/test.html
in a browser and you should be good to go.
If I have seen further, it is by standing on the shoulders of giants. - Sir Isaac Newton
- bootstrap-datepicker - Andrew Rowls and contributors
- bootstrap-datepicker original code - Stefan Petre
See LICENSE