Default: false Whether or not to close the datepicker immediately when a date is selected beforeshowday Function(Date). See the quick reference for an overview of all options and their default values autoclose Boolean. For example, startdate would be data-date-start-date, format would be data-date-format, and daysofweekdisabled would be data-date-days-of-week-disabled. An option can be converted to a data-attribute by taking its name, replacing each uppercase letter with its lowercase equivalent preceded by a dash, and prepending data-date- to the result. Most options can be provided via data-attributes. There are also aliases for the relative timedelta s: yesterday equals -1d, today is equal to +0d and tomorrow is equal to +1d. Markup with component You can disable datepicker s data-api in the same way as you would disable other bootstrap plugins: $(document).off('.datepicker.data-api') 3.2 Configuration Options are passed to the datepicker function via an options hash at instantiation: $('.datepicker').datepicker() ) 4.2 Options All options that take a Date can handle a Date object a String formatted according to the given format or a timedelta relative to today, eg -1d, +6m +1y, etc, where valid units are d (day), w (week), m (month), and y (year). For inline datepickers, use data-provide="datepicker-inline" these will be immediately initialized on page load, and cannot be lazily loaded. For most datepickers, simply set data-provide="datepicker" on the element you want to initialize, and it will be intialized lazily, in true bootstrap fashion. and bootstrap s sprites A standalone.css file (including necessary dropdown styles and alternative, text-based arrows) can be generated by running build/build_standalone.less through the lessc compiler: $ lessc build/build_standalone.less datepicker.css 5ġ1 CHAPTER 3 Usage Call the datepicker via javascript: $('.datepicker').datepicker() 3.1 Data API As with bootstrap s own plugins, datepicker provides a data-api that can be used to instantiate datepickers without the need for custom javascript. 3ĩ CHAPTER 2 Dependencies Requires bootstrap s dropdown component (dropdowns.less) for some styles, (sprites.less and associated images) for arrows. Online Demo Contents 1ħ CHAPTER 1 Requirements Bootstrap jquery These are the specific versions bootstrap-datepicker is tested against (js files) and built against (css files). Versions are incremented according to semver. This is a fork of Stefan Petre s original code thanks go to him for getting this thing started! Please note that this fork is not used on Stefan s page at this time, nor is it maintained or contributed to by him. 5 Bootstrap-datepicker provides a flexible datepicker widget in the Bootstrap style.
0 Comments
Leave a Reply. |