Update date range js

pull/2487/head
jmontoyaa 9 years ago
parent 2cb9fe84fb
commit 3608c51a01
  1. 16
      app/Resources/public/assets/bootstrap-daterangepicker/.bower.json
  2. 168
      app/Resources/public/assets/bootstrap-daterangepicker/README.md
  3. 6
      app/Resources/public/assets/bootstrap-daterangepicker/bower.json
  4. 303
      app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs2.css
  5. 335
      app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs3.css
  6. 2114
      app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker.js
  7. 272
      app/Resources/public/assets/bootstrap-daterangepicker/examples.html
  8. 6
      app/Resources/public/assets/bootstrap-daterangepicker/package.js
  9. 14
      app/Resources/public/assets/bootstrap-daterangepicker/package.json
  10. 2
      bower.json
  11. 389
      composer.lock
  12. 7
      main/inc/lib/formvalidator/Element/DateRangePicker.php
  13. 2
      main/inc/lib/template.lib.php

@ -2,7 +2,7 @@
"name": "bootstrap-daterangepicker",
"main": [
"daterangepicker.js",
"daterangepicker-bs3.css"
"daterangepicker.css"
],
"ignore": [
"**/.*",
@ -14,18 +14,18 @@
"moment.min.js"
],
"dependencies": {
"jquery": ">=1.10",
"moment": "~2.9.0"
"jquery": "1.9.1 - 3",
"moment": ">=2.9.0"
},
"homepage": "https://github.com/dangrossman/bootstrap-daterangepicker",
"version": "1.3.23",
"_release": "1.3.23",
"version": "2.1.25",
"_release": "2.1.25",
"_resolution": {
"type": "version",
"tag": "v1.3.23",
"commit": "f000ab2a40a0e930c2913855b96a4e4d59c8920f"
"tag": "v2.1.25",
"commit": "29bbf5a04df69fda363cedb534272ac344524e57"
},
"_source": "https://github.com/dangrossman/bootstrap-daterangepicker.git",
"_target": "1.3.*",
"_target": "2.1.*",
"_originalSource": "bootstrap-daterangepicker"
}

@ -6,169 +6,13 @@ This date range picker component for Bootstrap creates a dropdown menu from whic
select a range of dates. I created it while building the UI for [Improvely](http://www.improvely.com),
which needed a way to select date ranges for reports.
If invoked with no options, it will present two calendars to choose a start
and end date from. Optionally, you can provide a list of date ranges the user can select from instead
of choosing dates from the calendars. If attached to a text input, the selected dates will be inserted
into the text box. Otherwise, you can provide a custom callback function to receive the selection.
Features include limiting the selectable date range, localizable strings and date formats,
a single date picker mode, optional time picker (for e.g. making appointments or reservations),
and styles that match the default Bootstrap 3 theme.
The component can also be used as a single date picker by setting the `singleDatePicker` option to `true`.
## [Documentation and Live Usage Examples](http://www.daterangepicker.com)
**[View some examples](http://www.daterangepicker.com/)** or **[Try it in a live application](https://awio.iljmp.com/5/drpdemogh)**
## Usage
This component relies on [Bootstrap](http://getbootstrap.com),
[Moment.js](http://momentjs.com/) and [jQuery](http://jquery.com/).
Separate stylesheets are included for use with Bootstrap 2 or Bootstrap 3.
Basic usage:
```
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap.css" />
<link rel="stylesheet" type="text/css" href="daterangepicker-bs3.css" />
<script type="text/javascript">
$(document).ready(function() {
$('input[name="daterange"]').daterangepicker();
});
</script>
```
The constructor also takes an optional options object and callback function. The function will be called whenever
the selected date range has been changed by the user, and is passed the start and end dates (moment date objects)
and the predefined range label chosen (if any), as parameters. It will not fire if the picker is closed without
any change to the selected dates.
````
$('input[name="daterange"]').daterangepicker(
{
format: 'YYYY-MM-DD',
startDate: '2013-01-01',
endDate: '2013-12-31'
},
function(start, end, label) {
alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
}
);
````
Options may also be set using HTML5 data attributes. For example, timePicker="true" would be set with:
```
<input type="text" data-time-picker="true" name="daterange">
```
## Options
`startDate`: (Date object, moment object or string) The start of the initially selected date range
`endDate`: (Date object, moment object or string) The end of the initially selected date range
`minDate`: (Date object, moment object or string) The earliest date a user may select
`maxDate`: (Date object, moment object or string) The latest date a user may select
`dateLimit`: (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)
`timeZone`: (string or number) The timezone that will be used to display the startDate and endDate in the calendar. This may be a string such as "08:00" or an offset in minutes from Greenwich Mean Time. Uses Moment.js #utcOffset, [see the docs here](http://momentjs.com/docs/#/manipulating/utc-offset/) for more information. If the timeZone option is not set, the calendar will use the time zone set on the startDate that has been passed in through the options, if it has one. Defaults to the local time zone
`showDropdowns`: (boolean) Show year and month select boxes above calendars to jump to a specific month and year
`showWeekNumbers`: (boolean) Show week numbers at the start of each week on the calendars
`timePicker`: (boolean) Allow selection of dates with times, not just dates
`timePickerIncrement`: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30)
`timePicker12Hour`: (boolean) Use 12-hour instead of 24-hour times, adding an AM/PM select box
`timePickerSeconds`: (boolean) Show seconds in the timePicker
`ranges`: (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
`opens`: (string: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to
`drops`: (string: 'down' or 'up') Whether the picker opens below (default) or above the element it's attached to
`buttonClasses`: (array) CSS class names that will be added to all buttons in the picker
`applyClass`: (string) CSS class string that will be added to the apply button
`cancelClass`: (string) CSS class string that will be added to the cancel button
`format`: (string) Date/time format string used by moment when parsing or displaying the selected dates
`separator`: (string) Separator string to display between the start and end date when populating a text input the picker is attached to
`locale`: (object) Allows you to provide localized strings for buttons and labels, and the first day of week for the calendars
`singleDatePicker`: (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
`parentEl`: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be `'body'`
## Functions
Several functions are provided for updating the picker's option and state after initialization:
`setOptions(object, function)`: This function has the same signature and purpose as the date range picker's constructor: it sets the picker's options to their defaults, overrides them with any values in an options object you provide, and sets the callback for selection changes to whatever function you provide
`setStartDate(Date/moment/string)`: Sets the date range picker's currently selected start date to the provided date
`setEndDate(Date/moment/string)`: Sets the date range picker's currently selected end date to the provided date
Example usage:
````
//create a new date range picker
$('#daterange').daterangepicker({ startDate: '2014-03-05', endDate: '2014-03-06' });
//change the selected date range of that picker
$('#daterange').data('daterangepicker').setStartDate('2014-03-01');
$('#daterange').data('daterangepicker').setEndDate('2014-03-31');
````
## Events
Several events are triggered on the element you attach the picker to, which you can listen for:
`show.daterangepicker`: Triggered when the picker is shown
`hide.daterangepicker`: Triggered when the picker is hidden
`showCalendar.daterangepicker`: Triggered when the calendar is shown
`hideCalendar.daterangepicker`: Triggered when the calendar is hidden
`apply.daterangepicker`: Triggered when the apply button is clicked
`cancel.daterangepicker`: Triggered when the cancel button is clicked
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:
````
$('#daterange').daterangepicker({
locale: { cancelLabel: 'Clear' }
});
$('#daterange').on('cancel.daterangepicker', function(ev, picker) {
//do something, like clearing an input
$('#daterange').val('');
});
````
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:
````
$('#daterange').daterangepicker();
$('#daterange').on('apply.daterangepicker', function(ev, picker) {
console.log(picker.startDate.format('YYYY-MM-DD'));
console.log(picker.endDate.format('YYYY-MM-DD'));
});
````
## [See It In a Live Application](https://awio.iljmp.com/5/drpdemogh)
## License
@ -179,7 +23,7 @@ for convenience. It is available under the [MIT license](http://www.opensource.o
The MIT License (MIT)
Copyright (c) 2012-2014 Dan Grossman
Copyright (c) 2012-2016 Dan Grossman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

@ -2,7 +2,7 @@
"name": "bootstrap-daterangepicker",
"main": [
"daterangepicker.js",
"daterangepicker-bs3.css"
"daterangepicker.css"
],
"ignore": [
"**/.*",
@ -14,7 +14,7 @@
"moment.min.js"
],
"dependencies": {
"jquery": ">=1.10",
"moment": "~2.9.0"
"jquery": "1.9.1 - 3",
"moment": ">=2.9.0"
}
}

@ -1,303 +0,0 @@
/*!
* Stylesheet for the Date Range Picker, for use with Bootstrap 2.x
*
* Copyright 2013-2015 Dan Grossman ( http://www.dangrossman.info )
* Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
*
* Built for http://www.improvely.com
*/
.daterangepicker.dropdown-menu {
max-width: none;
z-index: 3000;
}
.daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar {
float: left;
margin: 4px;
}
.daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar,
.daterangepicker.openscenter .ranges, .daterangepicker.openscenter .calendar {
float: right;
margin: 4px;
}
.daterangepicker .ranges {
width: 160px;
text-align: left;
}
.daterangepicker .ranges .range_inputs>div {
float: left;
}
.daterangepicker .ranges .range_inputs>div:nth-child(2) {
padding-left: 11px;
}
.daterangepicker .calendar {
display: none;
max-width: 250px;
}
.daterangepicker.show-calendar .calendar {
display: block;
}
.daterangepicker .calendar.single .calendar-date {
border: none;
}
.daterangepicker .calendar th, .daterangepicker .calendar td {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
white-space: nowrap;
text-align: center;
}
.daterangepicker .daterangepicker_start_input label,
.daterangepicker .daterangepicker_end_input label {
color: #333;
font-size: 11px;
margin-bottom: 2px;
text-transform: uppercase;
text-shadow: 1px 1px 0 #fff;
}
.daterangepicker .ranges input {
font-size: 11px;
}
.daterangepicker .ranges ul {
list-style: none;
margin: 0;
padding: 0;
}
.daterangepicker .ranges li {
font-size: 13px;
background: #f5f5f5;
border: 1px solid #f5f5f5;
color: #08c;
padding: 3px 12px;
margin-bottom: 8px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
cursor: pointer;
}
.daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
background: #08c;
border: 1px solid #08c;
color: #fff;
}
.daterangepicker .calendar-date {
border: 1px solid #ddd;
padding: 4px;
border-radius: 4px;
background: #fff;
}
.daterangepicker .calendar-time {
text-align: center;
margin: 8px auto 0 auto;
line-height: 30px;
}
.daterangepicker {
position: absolute;
background: #fff;
top: 100px;
left: 20px;
padding: 4px;
margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.daterangepicker.opensleft:before {
position: absolute;
top: -7px;
right: 9px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.opensleft:after {
position: absolute;
top: -6px;
right: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.openscenter:before {
position: absolute;
top: -7px;
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.openscenter:after {
position: absolute;
top: -6px;
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.opensright:before {
position: absolute;
top: -7px;
left: 9px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.opensright:after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.dropup{
margin-top: -5px;
}
.daterangepicker.dropup:before{
top: initial;
bottom:-7px;
border-bottom: initial;
border-top: 7px solid #ccc;
}
.daterangepicker.dropup:after{
top: initial;
bottom:-6px;
border-bottom: initial;
border-top: 6px solid #fff;
}
.daterangepicker table {
width: 100%;
margin: 0;
}
.daterangepicker td, .daterangepicker th {
text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
white-space: nowrap;
}
.daterangepicker td.off {
color: #999;
}
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
}
.daterangepicker td.available:hover, .daterangepicker td.available.today, .daterangepicker th.available:hover {
background: #eee;
}
.daterangepicker td.in-range {
background: #ebf4f8;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.daterangepicker td.today.active, .daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(top, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc;
}
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%;
}
.daterangepicker select.yearselect {
width: 40%;
}
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 60px;
margin-bottom: 0;
}
.daterangepicker_start_input {
float: left;
}
.daterangepicker_end_input {
float: left;
padding-left: 11px
}
.daterangepicker th.month {
width: auto;
}

@ -1,335 +0,0 @@
/*!
* Stylesheet for the Date Range Picker, for use with Bootstrap 3.x
*
* Copyright 2013-2015 Dan Grossman ( http://www.dangrossman.info )
* Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
*
* Built for http://www.improvely.com
*/
.daterangepicker.dropdown-menu {
max-width: none;
z-index: 3000;
}
.daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar {
float: left;
margin: 4px;
}
.daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar,
.daterangepicker.openscenter .ranges, .daterangepicker.openscenter .calendar {
float: right;
margin: 4px;
}
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
float: none;
}
.daterangepicker .ranges {
width: 160px;
text-align: left;
}
.daterangepicker .ranges .range_inputs>div {
float: left;
}
.daterangepicker .ranges .range_inputs>div:nth-child(2) {
padding-left: 11px;
}
.daterangepicker .calendar {
display: none;
max-width: 270px;
}
.daterangepicker.show-calendar .calendar {
display: block;
}
.daterangepicker .calendar.single .calendar-date {
border: none;
}
.daterangepicker .calendar th, .daterangepicker .calendar td {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
white-space: nowrap;
text-align: center;
min-width: 32px;
}
.daterangepicker .daterangepicker_start_input label,
.daterangepicker .daterangepicker_end_input label {
color: #333;
display: block;
font-size: 11px;
font-weight: normal;
height: 20px;
line-height: 20px;
margin-bottom: 2px;
text-shadow: #fff 1px 1px 0px;
text-transform: uppercase;
width: 74px;
}
.daterangepicker .ranges input {
font-size: 11px;
}
.daterangepicker .ranges .input-mini {
border: 1px solid #ccc;
border-radius: 4px;
color: #555;
display: block;
font-size: 11px;
height: 30px;
line-height: 30px;
vertical-align: middle;
margin: 0 0 10px 0;
padding: 0 6px;
width: 74px;
}
.daterangepicker .ranges ul {
list-style: none;
margin: 0;
padding: 0;
}
.daterangepicker .ranges li {
font-size: 13px;
background: #f5f5f5;
border: 1px solid #f5f5f5;
color: #08c;
padding: 3px 12px;
margin-bottom: 8px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
cursor: pointer;
}
.daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
background: #08c;
border: 1px solid #08c;
color: #fff;
}
.daterangepicker .calendar-date {
border: 1px solid #ddd;
padding: 4px;
border-radius: 4px;
background: #fff;
}
.daterangepicker .calendar-time {
text-align: center;
margin: 8px auto 0 auto;
line-height: 30px;
}
.daterangepicker {
position: absolute;
background: #fff;
top: 100px;
left: 20px;
padding: 4px;
margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.daterangepicker.opensleft:before {
position: absolute;
top: -7px;
right: 9px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.opensleft:after {
position: absolute;
top: -6px;
right: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.openscenter:before {
position: absolute;
top: -7px;
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.openscenter:after {
position: absolute;
top: -6px;
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.opensright:before {
position: absolute;
top: -7px;
left: 9px;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.daterangepicker.opensright:after {
position: absolute;
top: -6px;
left: 10px;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent;
content: '';
}
.daterangepicker.dropup{
margin-top: -5px;
}
.daterangepicker.dropup:before{
top: initial;
bottom:-7px;
border-bottom: initial;
border-top: 7px solid #ccc;
}
.daterangepicker.dropup:after{
top: initial;
bottom:-6px;
border-bottom: initial;
border-top: 6px solid #fff;
}
.daterangepicker table {
width: 100%;
margin: 0;
}
.daterangepicker td, .daterangepicker th {
text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
white-space: nowrap;
}
.daterangepicker td.off {
color: #999;
}
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
}
.daterangepicker td.available:hover, .daterangepicker td.available.today, .daterangepicker th.available:hover {
background: #eee;
}
.daterangepicker td.in-range {
background: #ebf4f8;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.daterangepicker td.start-date {
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.daterangepicker td.end-date {
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.daterangepicker td.start-date.end-date {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.daterangepicker td.today.active, .daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd;
border-color: #3071a9;
color: #fff;
}
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc;
}
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default;
}
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%;
}
.daterangepicker select.yearselect {
width: 40%;
}
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px;
margin-bottom: 0;
}
.daterangepicker_start_input {
float: left;
}
.daterangepicker_end_input {
float: left;
padding-left: 11px
}
.daterangepicker th.month {
width: auto;
}

@ -1,272 +0,0 @@
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>A date range picker for Bootstrap</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker-bs3.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
</head>
<body>
<div class="container">
<div class="span12">
<h1>Usage Examples</h1>
<hr />
<h4>Basic Date Range Picker</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<div class="controls">
<div class="input-prepend input-group">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span><input type="text" style="width: 200px" name="reservation" id="reservation" class="form-control" value="03/18/2013 - 03/23/2013" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#reservation').daterangepicker(null, function(start, end, label) {
console.log(start.toISOString(), end.toISOString(), label);
});
});
</script>
</div>
<h4>Basic Single Date Picker</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<div class="controls">
<div class="input-prepend input-group">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span><input type="text" style="width: 200px" name="birthday" id="birthday" class="form-control" value="03/18/2013" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#birthday').daterangepicker({ singleDatePicker: true }, function(start, end, label) {
console.log(start.toISOString(), end.toISOString(), label);
});
});
</script>
</div>
<h4>Date Range &amp; Time Picker with 30 Minute Increments</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="reservationtime">Choose your check-in and check-out times:</label>
<div class="controls">
<div class="input-prepend input-group">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
<input type="text" style="width: 400px" name="reservation" id="reservationtime" class="form-control" value="08/01/2013 1:00 PM - 08/01/2013 1:30 PM" class="span4"/>
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#reservationtime').daterangepicker({
timePicker: true,
timePickerIncrement: 30,
format: 'MM/DD/YYYY h:mm A'
}, function(start, end, label) {
console.log(start.toISOString(), end.toISOString(), label);
});
});
</script>
</div>
<h4>Options Usage</h4>
<div class="well" style="overflow: auto">
<button id="options1" class="btn btn-primary">Apply Option Set 1</button>
<button id="options2" class="btn btn-primary">Apply Option Set 2</button>
<button id="destroy" class="btn btn-primary">Remove DateRangePicker</button>
<div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
<span></span> <b class="caret"></b>
</div>
<script type="text/javascript">
$(document).ready(function() {
var cb = function(start, end, label) {
console.log(start.toISOString(), end.toISOString(), label);
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
//alert("Callback has fired: [" + start.format('MMMM D, YYYY') + " to " + end.format('MMMM D, YYYY') + ", label = " + label + "]");
};
var optionSet1 = {
startDate: moment().subtract(29, 'days'),
endDate: moment(),
minDate: '01/01/2012',
maxDate: '12/31/2015',
dateLimit: { days: 60 },
showDropdowns: true,
showWeekNumbers: true,
timePicker: false,
timePickerIncrement: 1,
timePicker12Hour: true,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
opens: 'left',
buttonClasses: ['btn btn-default'],
applyClass: 'btn-sm btn-primary',
cancelClass: 'btn-sm',
format: 'MM/DD/YYYY',
separator: ' to ',
locale: {
applyLabel: 'Submit',
cancelLabel: 'Clear',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
}
};
var optionSet2 = {
startDate: moment().subtract(7, 'days'),
endDate: moment(),
opens: 'left',
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}
};
$('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
$('#reportrange').daterangepicker(optionSet1, cb);
$('#reportrange').on('show.daterangepicker', function() { console.log("show event fired"); });
$('#reportrange').on('hide.daterangepicker', function() { console.log("hide event fired"); });
$('#reportrange').on('apply.daterangepicker', function(ev, picker) {
console.log("apply event fired, start/end dates are "
+ picker.startDate.format('MMMM D, YYYY')
+ " to "
+ picker.endDate.format('MMMM D, YYYY')
);
});
$('#reportrange').on('cancel.daterangepicker', function(ev, picker) { console.log("cancel event fired"); });
$('#options1').click(function() {
$('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
});
$('#options2').click(function() {
$('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
});
$('#destroy').click(function() {
$('#reportrange').data('daterangepicker').remove();
});
});
</script>
</div>
<h4>Plays nicely with Bootstrap dropdowns</h4>
<div class="well">
<div class="dropdown" style="display: inline-block;">
<a data-toggle="dropdown" class="btn btn-primary" href="#">Regular bootstrap dropdown</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a href="#">item</a></li>
</ul>
</div>
<div id="reportrange2" class="btn" style="display: inline-block; background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
<span></span> <b class="caret"></b>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#reportrange2 span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
$('#reportrange2').daterangepicker({
opens: 'center'
});
});
</script>
</div>
<h4>And also can drop "up"</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<div class="controls">
<div class="input-prepend input-group">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span><input type="text" style="width: 200px" name="dropup" id="dropup" class="form-control" value="03/18/2013 - 03/23/2013" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#dropup').daterangepicker({
drops:'up'
});
});
</script>
</div>
</div>
</div>
</body>
</html>

@ -1,6 +1,6 @@
Package.describe({
name: 'dangrossman:bootstrap-daterangepicker',
version: '1.3.23',
version: '2.1.25',
summary: 'Date range picker component for Bootstrap',
git: 'https://github.com/dangrossman/bootstrap-daterangepicker',
documentation: 'README.md'
@ -9,10 +9,10 @@ Package.describe({
Package.onUse(function(api) {
api.versionsFrom('METEOR@0.9.0.1');
api.use('twbs:bootstrap@3.3.4', ["client"]);
api.use('twbs:bootstrap@3.3.4', ["client"], {weak: true});
api.use('momentjs:moment@2.10.3', ["client"]);
api.use('jquery@1.11.3_2', ["client"]);
api.addFiles('daterangepicker.js', ["client"]);
api.addFiles('daterangepicker-bs3.css', ["client"]);
api.addFiles('daterangepicker.css', ["client"]);
});

@ -1,10 +1,11 @@
{
"name": "bootstrap-daterangepicker",
"version": "1.3.23",
"version": "2.1.25",
"description": "Date range picker component for Bootstrap",
"main": "daterangepicker.js",
"style": "daterangepicker-bs3.css",
"style": "daterangepicker.css",
"scripts": {
"scss": "node-sass daterangepicker.scss > daterangepicker.css",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
@ -21,12 +22,11 @@
"url": "https://github.com/dangrossman/bootstrap-daterangepicker/issues"
},
"homepage": "https://github.com/dangrossman/bootstrap-daterangepicker",
"engines": {
"node": "0.10.32",
"nmp": "1.4.28"
},
"dependencies": {
"jquery": "^1.10",
"jquery": ">=1.10",
"moment": "^2.9.0"
},
"devDependencies": {
"node-sass": "^3.4.2"
}
}

@ -12,7 +12,7 @@
"fontawesome": "4.7.*",
"jquery": "2.2.0",
"jquery-ui": "1.11.*",
"bootstrap-daterangepicker": "1.3.*",
"bootstrap-daterangepicker": "2.1.*",
"ckeditor": "*",
"jquery-timeago": "1.4.*",
"mediaelement": "2.*",

389
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -96,8 +96,7 @@ class DateRangePicker extends HTML_QuickForm_text
// timeFormat: 'hh:mm'
$js .= "<script>
$(function() {
$('#$id').daterangepicker({
format: '$format',
$('#$id').daterangepicker({
timePicker: $timePicker,
timePickerIncrement: 30,
timePicker12Hour: false,
@ -110,8 +109,10 @@ class DateRangePicker extends HTML_QuickForm_text
'".addslashes(get_lang('NextWeek'))."': [moment().weekday(8), moment().weekday(12)]
},
//showDropdowns : true,
separator: ' / ',
locale: {
separator: ' / ',
format: '$format',
applyLabel: '".addslashes(get_lang('Ok'))."',
cancelLabel: '".addslashes(get_lang('Cancel'))."',
fromLabel: '".addslashes(get_lang('From'))."',

@ -538,7 +538,6 @@ class Template
// Default CSS Bootstrap
$bowerCSSFiles = [
'bootstrap-daterangepicker/daterangepicker-bs3.css',
'fontawesome/css/font-awesome.min.css',
'jquery-ui/themes/smoothness/theme.css',
'jquery-ui/themes/smoothness/jquery-ui.min.css',
@ -546,6 +545,7 @@ class Template
'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.css',
'bootstrap/dist/css/bootstrap.min.css',
'jquery.scrollbar/jquery.scrollbar.css',
'bootstrap-daterangepicker/daterangepicker.css',
];
foreach ($bowerCSSFiles as $file) {

Loading…
Cancel
Save