for selecting dates, times, or from predefined ranges like "Last 30 Days".
for selecting dates, times, or from predefined ranges like "Last 30 Days".
</p>
</p>
<astyle="display: block; height: 300px; background: url('drp.png') top right no-repeat; background-size: cover; border: 1px solid #ccc; margin-bottom: 20px"href="https://awio.iljmp.com/5/drpdemo"title="Click for a Live Demo"></a>
<astyle="display: block; height: 300px; background: url('drp.png') top right no-repeat; background-size: cover; border: 1px solid #ccc; margin-bottom: 20px"
href="https://awio.iljmp.com/5/drpdemo"title="Click for a Live Demo"></a>
</div>
</div>
...
@@ -160,7 +167,8 @@
...
@@ -160,7 +167,8 @@
<h2>Usage</h2>
<h2>Usage</h2>
<p>
<p>
Date Range Picker relies on <ahref="http://getbootstrap.com/">Bootstrap</a>, <ahref="http://www.jquery.com/">jQuery</a> and <ahref="http://momentjs.com/">Moment.js</a>.
Date Range Picker relies on <ahref="http://getbootstrap.com/">Bootstrap</a>, <a
href="http://www.jquery.com/">jQuery</a> and <ahref="http://momentjs.com/">Moment.js</a>.
Include the required scripts and stylesheet in your page:
Include the required scripts and stylesheet in your page:
<code>startDate</code> (Date object, moment object or string) The start of the initially selected date range
<code>startDate</code> (Date object, moment object or string) The start of the initially
selected date range
</li>
</li>
<li>
<li>
<code>endDate</code>: (Date object, moment object or string) The end of the initially selected date range
<code>endDate</code>: (Date object, moment object or string) The end of the initially selected
date range
</li>
</li>
<li>
<li>
<code>minDate</code>: (Date object, moment object or string) The earliest date a user may select
<code>minDate</code>: (Date object, moment object or string) The earliest date a user may select
...
@@ -597,31 +611,39 @@
...
@@ -597,31 +611,39 @@
<code>maxDate</code>: (Date object, moment object or string) The latest date a user may select
<code>maxDate</code>: (Date object, moment object or string) The latest date a user may select
</li>
</li>
<li>
<li>
<code>dateLimit</code>: (object) The maximum span between the selected start and end dates. Can have any property you can add to a moment object (i.e. days, months)
<code>dateLimit</code>: (object) The maximum span between the selected start and end dates. Can
have any property you can add to a moment object (i.e. days, months)
</li>
</li>
<li>
<li>
<code>showDropdowns</code>: (boolean) Show year and month select boxes above calendars to jump to a specific month and year
<code>showDropdowns</code>: (boolean) Show year and month select boxes above calendars to jump
to a specific month and year
</li>
</li>
<li>
<li>
<code>showWeekNumbers</code>: (boolean) Show localized week numbers at the start of each week on the calendars
<code>showWeekNumbers</code>: (boolean) Show localized week numbers at the start of each week on
the calendars
</li>
</li>
<li>
<li>
<code>showISOWeekNumbers</code>: (boolean) Show ISO week numbers at the start of each week on the calendars
<code>showISOWeekNumbers</code>: (boolean) Show ISO week numbers at the start of each week on
the calendars
</li>
</li>
<li>
<li>
<code>timePicker</code>: (boolean) Allow selection of dates with times, not just dates
<code>timePicker</code>: (boolean) Allow selection of dates with times, not just dates
</li>
</li>
<li>
<li>
<code>timePickerIncrement</code>: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30)
<code>timePickerIncrement</code>: (number) Increment of the minutes selection list for times
(i.e. 30 to allow only selection of times ending in 0 or 30)
</li>
</li>
<li>
<li>
<code>timePicker24Hour</code>: (boolean) Use 24-hour instead of 12-hour times, removing the AM/PM selection
<code>timePicker24Hour</code>: (boolean) Use 24-hour instead of 12-hour times, removing the
AM/PM selection
</li>
</li>
<li>
<li>
<code>timePickerSeconds</code>: (boolean) Show seconds in the timePicker
<code>timePickerSeconds</code>: (boolean) Show seconds in the timePicker
</li>
</li>
<li>
<li>
<code>ranges</code>: (object) Set predefined date ranges the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range
<code>ranges</code>: (object) Set predefined date ranges the user can select from. Each key is
the label for the range, and its value an array with two dates representing the bounds of the
range
</li>
</li>
<li>
<li>
<code>showCustomRangeLabel</code>: (boolean) Displays an item labeled "Custom Range" at
<code>showCustomRangeLabel</code>: (boolean) Displays an item labeled "Custom Range" at
...
@@ -631,16 +653,21 @@
...
@@ -631,16 +653,21 @@
</li>
</li>
<li>
<li>
<code>alwaysShowCalendars</code>: (boolean) Normally, if you use the <code>ranges</code>
<code>alwaysShowCalendars</code>: (boolean) Normally, if you use the <code>ranges</code>
option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range". When this option is set to true, the calendars for choosing a custom date range are always shown instead.
option to specify pre-defined date ranges, calendars for choosing a custom date range are not
shown until the user clicks "Custom Range". When this option is set to true, the calendars for
choosing a custom date range are always shown instead.
</li>
</li>
<li>
<li>
<code>opens</code>: (string</code>: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to
<code>opens</code>: (string</code>: 'left'/'right'/'center') Whether the picker appears aligned
to the left, to the right, or centered under the HTML element it's attached to
</li>
</li>
<li>
<li>
<code>drops</code>: (string</code>: 'down' or 'up') Whether the picker appears below (default) or above the HTML element it's attached to
<code>drops</code>: (string</code>: 'down' or 'up') Whether the picker appears below (default)
or above the HTML element it's attached to
</li>
</li>
<li>
<li>
<code>buttonClasses</code>: (array) CSS class names that will be added to all buttons in the picker
<code>buttonClasses</code>: (array) CSS class names that will be added to all buttons in the
picker
</li>
</li>
<li>
<li>
<code>applyClass</code>: (string) CSS class string that will be added to the apply button
<code>applyClass</code>: (string) CSS class string that will be added to the apply button
...
@@ -649,18 +676,25 @@
...
@@ -649,18 +676,25 @@
<code>cancelClass</code>: (string) CSS class string that will be added to the cancel button
<code>cancelClass</code>: (string) CSS class string that will be added to the cancel button
</li>
</li>
<li>
<li>
<code>locale</code>: (object) Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars.
<code>locale</code>: (object) Allows you to provide localized strings for buttons and labels,
customize the date format, and change the first day of week for the calendars.
Check off "locale (with example settings)" in the configuration generator to see how
Check off "locale (with example settings)" in the configuration generator to see how
to customize these options.
to customize these options.
</li>
</li>
<li>
<li>
<code>singleDatePicker</code>: (boolean) Show only a single calendar to choose one date, instead of a range picker with two calendars; the start and end dates provided to your callback will be the same single date chosen
<code>singleDatePicker</code>: (boolean) Show only a single calendar to choose one date, instead
of a range picker with two calendars; the start and end dates provided to your callback will be
the same single date chosen
</li>
</li>
<li>
<li>
<code>autoApply</code>: (boolean) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates or a predefined range is selected
<code>autoApply</code>: (boolean) Hide the apply and cancel buttons, and automatically apply a
new date range as soon as two dates or a predefined range is selected
</li>
</li>
<li>
<li>
<code>linkedCalendars</code>: (boolean) When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars. When disabled, the two calendars can be individually advanced and display any month/year.
<code>linkedCalendars</code>: (boolean) When enabled, the two calendars displayed will always be
for two sequential months (i.e. January and February), and both will be advanced when clicking
the left or right arrows above the calendars. When disabled, the two calendars can be
individually advanced and display any month/year.
</li>
</li>
<li>
<li>
<code>isInvalidDate</code>: (function) A function that is passed each date in the two
<code>isInvalidDate</code>: (function) A function that is passed each date in the two
...
@@ -678,7 +712,8 @@
...
@@ -678,7 +712,8 @@
at initialization and when the selected dates change.
at initialization and when the selected dates change.
</li>
</li>
<li>
<li>
<code>parentEl</code>: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body'
<code>parentEl</code>: (string) jQuery selector of the parent element that the date range picker
will be added to, if not provided this will be 'body'
<code>setStartDate(Date/moment/string)</code>: Sets the date range picker's currently selected start date to the provided date
<code>setStartDate(Date/moment/string)</code>: Sets the date range picker's currently selected
start date to the provided date
</li>
</li>
<li>
<li>
<code>setEndDate(Date/moment/string)</code>: Sets the date range picker's currently selected end date to the provided date
<code>setEndDate(Date/moment/string)</code>: Sets the date range picker's currently selected end
date to the provided date
</li>
</li>
</ul>
</ul>
...
@@ -745,15 +782,18 @@
...
@@ -745,15 +782,18 @@
</ul>
</ul>
<p>
<p>
Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by changing the button label and watching for the cancel event:
Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by
changing the button label and watching for the cancel event:
While passing in a callback to the constructor is the easiest way to listen for changes in the selected date range, you can also do something every time the apply button is clicked even if the selection hasn't changed:
While passing in a callback to the constructor is the easiest way to listen for changes in the
selected date range, you can also do something every time the apply button is clicked even if the
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
</p>
</p>
<p>
<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
</p>
</p>
<p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
</p>
</div>
</div>
...
@@ -796,41 +845,72 @@
...
@@ -796,41 +845,72 @@
vardisqus_title="A Date Range Picker for Bootstrap";
vardisqus_title="A Date Range Picker for Bootstrap";