From 3608c51a018d1e4653d8c75c24bde05cc2b1a0fb Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 7 Mar 2017 12:52:38 +0100 Subject: [PATCH] Update date range js --- .../bootstrap-daterangepicker/.bower.json | 16 +- .../bootstrap-daterangepicker/README.md | 168 +- .../bootstrap-daterangepicker/bower.json | 6 +- .../daterangepicker-bs2.css | 303 --- .../daterangepicker-bs3.css | 335 --- .../daterangepicker.js | 2114 ++++++++++------- .../bootstrap-daterangepicker/examples.html | 272 --- .../bootstrap-daterangepicker/package.js | 6 +- .../bootstrap-daterangepicker/package.json | 14 +- bower.json | 2 +- composer.lock | 389 +-- .../formvalidator/Element/DateRangePicker.php | 7 +- main/inc/lib/template.lib.php | 2 +- 13 files changed, 1431 insertions(+), 2203 deletions(-) delete mode 100644 app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs2.css delete mode 100644 app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs3.css delete mode 100644 app/Resources/public/assets/bootstrap-daterangepicker/examples.html diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/.bower.json b/app/Resources/public/assets/bootstrap-daterangepicker/.bower.json index b062c319bd..3a84455abc 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/.bower.json +++ b/app/Resources/public/assets/bootstrap-daterangepicker/.bower.json @@ -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" } \ No newline at end of file diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/README.md b/app/Resources/public/assets/bootstrap-daterangepicker/README.md index 7983c4cc73..30d319743e 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/README.md +++ b/app/Resources/public/assets/bootstrap-daterangepicker/README.md @@ -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: - -``` - - - - - - - -``` - -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: - -``` - -``` - -## 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 diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/bower.json b/app/Resources/public/assets/bootstrap-daterangepicker/bower.json index fff6f78fdb..d42995a62c 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/bower.json +++ b/app/Resources/public/assets/bootstrap-daterangepicker/bower.json @@ -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" } } diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs2.css b/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs2.css deleted file mode 100644 index 870e17625f..0000000000 --- a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs2.css +++ /dev/null @@ -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; -} diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs3.css b/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs3.css deleted file mode 100644 index 9388916d5d..0000000000 --- a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker-bs3.css +++ /dev/null @@ -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; -} diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker.js b/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker.js index e40a0e303e..733d27405c 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker.js +++ b/app/Resources/public/assets/bootstrap-daterangepicker/daterangepicker.js @@ -1,569 +1,1044 @@ /** -* @version: 1.3.23 +* @version: 2.1.25 * @author: Dan Grossman http://www.dangrossman.info/ -* @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved. +* @copyright: Copyright (c) 2012-2017 Dan Grossman. All rights reserved. * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php -* @website: https://www.improvely.com/ +* @website: https://www.daterangepicker.com/ */ - -(function(root, factory) { - - if (typeof define === 'function' && define.amd) { - define(['moment', 'jquery', 'exports'], function(momentjs, $, exports) { - root.daterangepicker = factory(root, exports, momentjs, $); - }); - - } else if (typeof exports !== 'undefined') { - var momentjs = require('moment'); - var jQuery; - try { - jQuery = require('jquery'); - } catch (err) { - jQuery = window.jQuery; - if (!jQuery) throw new Error('jQuery dependency not found'); +// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Make globaly available as well + define(['moment', 'jquery'], function (moment, jquery) { + return (root.daterangepicker = factory(moment, jquery)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node / Browserify + //isomorphic issue + var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; + if (!jQuery) { + jQuery = require('jquery'); + if (!jQuery.fn) jQuery.fn = {}; + } + module.exports = factory(require('moment'), jQuery); + } else { + // Browser globals + root.daterangepicker = factory(root.moment, root.jQuery); } +}(this, function(moment, $) { + var DateRangePicker = function(element, options, cb) { - factory(root, exports, momentjs, jQuery); - - // Finally, as a browser global. - } else { - root.daterangepicker = factory(root, {}, root.moment || moment, (root.jQuery || root.Zepto || root.ender || root.$)); - } - -}(this, function(root, daterangepicker, moment, $) { - - var DateRangePicker = function (element, options, cb) { - - // by default, the daterangepicker element is placed at the bottom of HTML body + //default settings for options this.parentEl = 'body'; - - //element that triggered the date range picker this.element = $(element); - - //tracks visible state + this.startDate = moment().startOf('day'); + this.endDate = moment().endOf('day'); + this.minDate = false; + this.maxDate = false; + this.dateLimit = false; + this.autoApply = false; + this.singleDatePicker = false; + this.showDropdowns = false; + this.showWeekNumbers = false; + this.showISOWeekNumbers = false; + this.showCustomRangeLabel = true; + this.timePicker = false; + this.timePicker24Hour = false; + this.timePickerIncrement = 1; + this.timePickerSeconds = false; + this.linkedCalendars = true; + this.autoUpdateInput = true; + this.alwaysShowCalendars = false; + this.ranges = {}; + + this.opens = 'right'; + if (this.element.hasClass('pull-right')) + this.opens = 'left'; + + this.drops = 'down'; + if (this.element.hasClass('dropup')) + this.drops = 'up'; + + this.buttonClasses = 'btn btn-sm'; + this.applyClass = 'btn-success'; + this.cancelClass = 'btn-default'; + + this.locale = { + direction: 'ltr', + format: moment.localeData().longDateFormat('L'), + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + weekLabel: 'W', + customRangeLabel: 'Custom Range', + daysOfWeek: moment.weekdaysMin(), + monthNames: moment.monthsShort(), + firstDay: moment.localeData().firstDayOfWeek() + }; + + this.callback = function() { }; + + //some state information this.isShowing = false; + this.leftCalendar = {}; + this.rightCalendar = {}; - //create the picker HTML object - var DRPTemplate = ''; - - //custom options + //custom options from user if (typeof options !== 'object' || options === null) options = {}; - this.parentEl = (typeof options === 'object' && options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl); - this.container = $(DRPTemplate).appendTo(this.parentEl); - //allow setting options with data attributes //data-api options will be overwritten with custom javascript options options = $.extend(this.element.data(), options); - - this.setOptions(options, cb); - //event listeners + //html template for the picker UI + if (typeof options.template !== 'string' && !(options.template instanceof $)) + options.template = ''; + + this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl); + this.container = $(options.template).appendTo(this.parentEl); + + // + // handle all the possible options overriding defaults + // + + if (typeof options.locale === 'object') { + + if (typeof options.locale.direction === 'string') + this.locale.direction = options.locale.direction; + + if (typeof options.locale.format === 'string') + this.locale.format = options.locale.format; + + if (typeof options.locale.separator === 'string') + this.locale.separator = options.locale.separator; + + if (typeof options.locale.daysOfWeek === 'object') + this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + + if (typeof options.locale.monthNames === 'object') + this.locale.monthNames = options.locale.monthNames.slice(); + + if (typeof options.locale.firstDay === 'number') + this.locale.firstDay = options.locale.firstDay; + + if (typeof options.locale.applyLabel === 'string') + this.locale.applyLabel = options.locale.applyLabel; + + if (typeof options.locale.cancelLabel === 'string') + this.locale.cancelLabel = options.locale.cancelLabel; + + if (typeof options.locale.weekLabel === 'string') + this.locale.weekLabel = options.locale.weekLabel; + + if (typeof options.locale.customRangeLabel === 'string'){ + //Support unicode chars in the custom range name. + var elem = document.createElement('textarea'); + elem.innerHTML = options.locale.customRangeLabel; + var rangeHtml = elem.value; + this.locale.customRangeLabel = rangeHtml; + } + } + this.container.addClass(this.locale.direction); + + if (typeof options.startDate === 'string') + this.startDate = moment(options.startDate, this.locale.format); + + if (typeof options.endDate === 'string') + this.endDate = moment(options.endDate, this.locale.format); + + if (typeof options.minDate === 'string') + this.minDate = moment(options.minDate, this.locale.format); + + if (typeof options.maxDate === 'string') + this.maxDate = moment(options.maxDate, this.locale.format); + + if (typeof options.startDate === 'object') + this.startDate = moment(options.startDate); + + if (typeof options.endDate === 'object') + this.endDate = moment(options.endDate); + + if (typeof options.minDate === 'object') + this.minDate = moment(options.minDate); + + if (typeof options.maxDate === 'object') + this.maxDate = moment(options.maxDate); + + // sanity check for bad options + if (this.minDate && this.startDate.isBefore(this.minDate)) + this.startDate = this.minDate.clone(); + + // sanity check for bad options + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); + + if (typeof options.applyClass === 'string') + this.applyClass = options.applyClass; + + if (typeof options.cancelClass === 'string') + this.cancelClass = options.cancelClass; + + if (typeof options.dateLimit === 'object') + this.dateLimit = options.dateLimit; + + if (typeof options.opens === 'string') + this.opens = options.opens; + + if (typeof options.drops === 'string') + this.drops = options.drops; + + if (typeof options.showWeekNumbers === 'boolean') + this.showWeekNumbers = options.showWeekNumbers; + + if (typeof options.showISOWeekNumbers === 'boolean') + this.showISOWeekNumbers = options.showISOWeekNumbers; + + if (typeof options.buttonClasses === 'string') + this.buttonClasses = options.buttonClasses; + + if (typeof options.buttonClasses === 'object') + this.buttonClasses = options.buttonClasses.join(' '); + + if (typeof options.showDropdowns === 'boolean') + this.showDropdowns = options.showDropdowns; + + if (typeof options.showCustomRangeLabel === 'boolean') + this.showCustomRangeLabel = options.showCustomRangeLabel; + + if (typeof options.singleDatePicker === 'boolean') { + this.singleDatePicker = options.singleDatePicker; + if (this.singleDatePicker) + this.endDate = this.startDate.clone(); + } + + if (typeof options.timePicker === 'boolean') + this.timePicker = options.timePicker; + + if (typeof options.timePickerSeconds === 'boolean') + this.timePickerSeconds = options.timePickerSeconds; + + if (typeof options.timePickerIncrement === 'number') + this.timePickerIncrement = options.timePickerIncrement; + + if (typeof options.timePicker24Hour === 'boolean') + this.timePicker24Hour = options.timePicker24Hour; + + if (typeof options.autoApply === 'boolean') + this.autoApply = options.autoApply; + + if (typeof options.autoUpdateInput === 'boolean') + this.autoUpdateInput = options.autoUpdateInput; + + if (typeof options.linkedCalendars === 'boolean') + this.linkedCalendars = options.linkedCalendars; + + if (typeof options.isInvalidDate === 'function') + this.isInvalidDate = options.isInvalidDate; + + if (typeof options.isCustomDate === 'function') + this.isCustomDate = options.isCustomDate; + + if (typeof options.alwaysShowCalendars === 'boolean') + this.alwaysShowCalendars = options.alwaysShowCalendars; + + // update day names order to firstDay + if (this.locale.firstDay != 0) { + var iterator = this.locale.firstDay; + while (iterator > 0) { + this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); + iterator--; + } + } + + var start, end, range; + + //if no start/end dates set, check if an input element contains initial values + if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { + if ($(this.element).is('input[type=text]')) { + var val = $(this.element).val(), + split = val.split(this.locale.separator); + + start = end = null; + + if (split.length == 2) { + start = moment(split[0], this.locale.format); + end = moment(split[1], this.locale.format); + } else if (this.singleDatePicker && val !== "") { + start = moment(val, this.locale.format); + end = moment(val, this.locale.format); + } + if (start !== null && end !== null) { + this.setStartDate(start); + this.setEndDate(end); + } + } + } + + if (typeof options.ranges === 'object') { + for (range in options.ranges) { + + if (typeof options.ranges[range][0] === 'string') + start = moment(options.ranges[range][0], this.locale.format); + else + start = moment(options.ranges[range][0]); + + if (typeof options.ranges[range][1] === 'string') + end = moment(options.ranges[range][1], this.locale.format); + else + end = moment(options.ranges[range][1]); + + // If the start or end date exceed those allowed by the minDate or dateLimit + // options, shorten the range to the allowable period. + if (this.minDate && start.isBefore(this.minDate)) + start = this.minDate.clone(); + + var maxDate = this.maxDate; + if (this.dateLimit && maxDate && start.clone().add(this.dateLimit).isAfter(maxDate)) + maxDate = start.clone().add(this.dateLimit); + if (maxDate && end.isAfter(maxDate)) + end = maxDate.clone(); + + // If the end of the range is before the minimum or the start of the range is + // after the maximum, don't display this range option at all. + if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day')) + || (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day'))) + continue; + + //Support unicode chars in the range names. + var elem = document.createElement('textarea'); + elem.innerHTML = range; + var rangeHtml = elem.value; + + this.ranges[rangeHtml] = [start, end]; + } + + var list = ''; + this.container.find('.ranges').prepend(list); + } + + if (typeof cb === 'function') { + this.callback = cb; + } + + if (!this.timePicker) { + this.startDate = this.startDate.startOf('day'); + this.endDate = this.endDate.endOf('day'); + this.container.find('.calendar-time').hide(); + } + + //can't be used together for now + if (this.timePicker && this.autoApply) + this.autoApply = false; + + if (this.autoApply && typeof options.ranges !== 'object') { + this.container.find('.ranges').hide(); + } else if (this.autoApply) { + this.container.find('.applyBtn, .cancelBtn').addClass('hide'); + } + + if (this.singleDatePicker) { + this.container.addClass('single'); + this.container.find('.calendar.left').addClass('single'); + this.container.find('.calendar.left').show(); + this.container.find('.calendar.right').hide(); + this.container.find('.daterangepicker_input input, .daterangepicker_input > i').hide(); + if (this.timePicker) { + this.container.find('.ranges ul').hide(); + } else { + this.container.find('.ranges').hide(); + } + } + + if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) { + this.container.addClass('show-calendar'); + } + + this.container.addClass('opens' + this.opens); + + //swap the position of the predefined ranges if opens right + if (typeof options.ranges !== 'undefined' && this.opens == 'right') { + this.container.find('.ranges').prependTo( this.container.find('.calendar.left').parent() ); + } + + //apply CSS classes and labels to buttons + this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses); + if (this.applyClass.length) + this.container.find('.applyBtn').addClass(this.applyClass); + if (this.cancelClass.length) + this.container.find('.cancelBtn').addClass(this.cancelClass); + this.container.find('.applyBtn').html(this.locale.applyLabel); + this.container.find('.cancelBtn').html(this.locale.cancelLabel); + + // + // event listeners + // + this.container.find('.calendar') .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)) .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)) - .on('click.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) + .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)) .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this)) - .on('change.daterangepicker', 'select.yearselect', $.proxy(this.updateMonthYear, this)) - .on('change.daterangepicker', 'select.monthselect', $.proxy(this.updateMonthYear, this)) - .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.updateTime, this)); + .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this)) + .on('click.daterangepicker', '.daterangepicker_input input', $.proxy(this.showCalendars, this)) + .on('focus.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsFocused, this)) + .on('blur.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsBlurred, this)) + .on('change.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsChanged, this)); this.container.find('.ranges') .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)) - .on('click.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.showCalendars, this)) - .on('change.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.inputsChanged, this)) - .on('keydown.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.inputsKeydown, this)) .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)) - .on('mouseenter.daterangepicker', 'li', $.proxy(this.enterRange, this)) + .on('mouseenter.daterangepicker', 'li', $.proxy(this.hoverRange, this)) .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this)); - if (this.element.is('input')) { + if (this.element.is('input') || this.element.is('button')) { this.element.on({ 'click.daterangepicker': $.proxy(this.show, this), 'focus.daterangepicker': $.proxy(this.show, this), - 'keyup.daterangepicker': $.proxy(this.updateFromControl, this), + 'keyup.daterangepicker': $.proxy(this.elementChanged, this), 'keydown.daterangepicker': $.proxy(this.keydown, this) }); } else { this.element.on('click.daterangepicker', $.proxy(this.toggle, this)); } + // + // if attached to a text input, set the initial value + // + + if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.element.trigger('change'); + } else if (this.element.is('input') && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format)); + this.element.trigger('change'); + } + }; DateRangePicker.prototype = { constructor: DateRangePicker, - setOptions: function(options, callback) { - - this.startDate = moment().startOf('day'); - this.endDate = moment().endOf('day'); - this.timeZone = moment().utcOffset(); - this.minDate = false; - this.maxDate = false; - this.dateLimit = false; - - this.showDropdowns = false; - this.showWeekNumbers = false; - this.timePicker = false; - this.timePickerSeconds = false; - this.timePickerIncrement = 30; - this.timePicker12Hour = true; - this.autoApply = false; - this.singleDatePicker = false; - this.ranges = {}; - - this.opens = 'right'; - if (this.element.hasClass('pull-right')) - this.opens = 'left'; + setStartDate: function(startDate) { + if (typeof startDate === 'string') + this.startDate = moment(startDate, this.locale.format); - this.drops = 'down'; - if (this.element.hasClass('dropup')) - this.drops = 'up'; + if (typeof startDate === 'object') + this.startDate = moment(startDate); - this.buttonClasses = ['btn', 'btn-small btn-sm']; - this.applyClass = 'btn-success'; - this.cancelClass = 'btn-default'; + if (!this.timePicker) + this.startDate = this.startDate.startOf('day'); - this.format = 'MM/DD/YYYY'; - this.separator = ' - '; + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); - this.locale = { - applyLabel: 'Apply', - cancelLabel: 'Cancel', - fromLabel: 'From', - toLabel: 'To', - weekLabel: 'W', - customRangeLabel: 'Custom Range', - daysOfWeek: moment.weekdaysMin(), - monthNames: moment.monthsShort(), - firstDay: moment.localeData()._week.dow - }; + if (this.minDate && this.startDate.isBefore(this.minDate)) { + this.startDate = this.minDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } - this.cb = function () { }; + if (this.maxDate && this.startDate.isAfter(this.maxDate)) { + this.startDate = this.maxDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } - if (typeof options.format === 'string') - this.format = options.format; + if (!this.isShowing) + this.updateElement(); - if (typeof options.separator === 'string') - this.separator = options.separator; + this.updateMonthsInView(); + }, - if (typeof options.startDate === 'string') - this.startDate = moment(options.startDate, this.format); + setEndDate: function(endDate) { + if (typeof endDate === 'string') + this.endDate = moment(endDate, this.locale.format); - if (typeof options.endDate === 'string') - this.endDate = moment(options.endDate, this.format); + if (typeof endDate === 'object') + this.endDate = moment(endDate); - if (typeof options.minDate === 'string') - this.minDate = moment(options.minDate, this.format); + if (!this.timePicker) + this.endDate = this.endDate.endOf('day'); - if (typeof options.maxDate === 'string') - this.maxDate = moment(options.maxDate, this.format); + if (this.timePicker && this.timePickerIncrement) + this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); - if (typeof options.startDate === 'object') - this.startDate = moment(options.startDate); + if (this.endDate.isBefore(this.startDate)) + this.endDate = this.startDate.clone(); - if (typeof options.endDate === 'object') - this.endDate = moment(options.endDate); + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); - if (typeof options.minDate === 'object') - this.minDate = moment(options.minDate); + if (this.dateLimit && this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)) + this.endDate = this.startDate.clone().add(this.dateLimit); - if (typeof options.maxDate === 'object') - this.maxDate = moment(options.maxDate); + this.previousRightTime = this.endDate.clone(); - if (typeof options.applyClass === 'string') - this.applyClass = options.applyClass; + if (!this.isShowing) + this.updateElement(); - if (typeof options.cancelClass === 'string') - this.cancelClass = options.cancelClass; + this.updateMonthsInView(); + }, - if (typeof options.dateLimit === 'object') - this.dateLimit = options.dateLimit; + isInvalidDate: function() { + return false; + }, - if (typeof options.locale === 'object') { + isCustomDate: function() { + return false; + }, - if (typeof options.locale.daysOfWeek === 'object') { - // Create a copy of daysOfWeek to avoid modification of original - // options object for reusability in multiple daterangepicker instances - this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + updateView: function() { + if (this.timePicker) { + this.renderTimePicker('left'); + this.renderTimePicker('right'); + if (!this.endDate) { + this.container.find('.right .calendar-time select').attr('disabled', 'disabled').addClass('disabled'); + } else { + this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled'); } + } + if (this.endDate) { + this.container.find('input[name="daterangepicker_end"]').removeClass('active'); + this.container.find('input[name="daterangepicker_start"]').addClass('active'); + } else { + this.container.find('input[name="daterangepicker_end"]').addClass('active'); + this.container.find('input[name="daterangepicker_start"]').removeClass('active'); + } + this.updateMonthsInView(); + this.updateCalendars(); + this.updateFormInputs(); + }, - if (typeof options.locale.monthNames === 'object') { - this.locale.monthNames = options.locale.monthNames.slice(); - } + updateMonthsInView: function() { + if (this.endDate) { - if (typeof options.locale.firstDay === 'number') { - this.locale.firstDay = options.locale.firstDay; + //if both dates are visible already, do nothing + if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && + (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + && + (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + ) { + return; } - if (typeof options.locale.applyLabel === 'string') { - this.locale.applyLabel = options.locale.applyLabel; + this.leftCalendar.month = this.startDate.clone().date(2); + if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) { + this.rightCalendar.month = this.endDate.clone().date(2); + } else { + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); } - if (typeof options.locale.cancelLabel === 'string') { - this.locale.cancelLabel = options.locale.cancelLabel; + } else { + if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) { + this.leftCalendar.month = this.startDate.clone().date(2); + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); } + } + if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) { + this.rightCalendar.month = this.maxDate.clone().date(2); + this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month'); + } + }, + + updateCalendars: function() { - if (typeof options.locale.fromLabel === 'string') { - this.locale.fromLabel = options.locale.fromLabel; + if (this.timePicker) { + var hour, minute, second; + if (this.endDate) { + hour = parseInt(this.container.find('.left .hourselect').val(), 10); + minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + } else { + hour = parseInt(this.container.find('.right .hourselect').val(), 10); + minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } } + this.leftCalendar.month.hour(hour).minute(minute).second(second); + this.rightCalendar.month.hour(hour).minute(minute).second(second); + } + + this.renderCalendar('left'); + this.renderCalendar('right'); + + //highlight any predefined range matching the current start and end dates + this.container.find('.ranges li').removeClass('active'); + if (this.endDate == null) return; + + this.calculateChosenLabel(); + }, + + renderCalendar: function(side) { + + // + // Build the matrix of dates that will populate the calendar + // + + var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar; + var month = calendar.month.month(); + var year = calendar.month.year(); + var hour = calendar.month.hour(); + var minute = calendar.month.minute(); + var second = calendar.month.second(); + var daysInMonth = moment([year, month]).daysInMonth(); + var firstDay = moment([year, month, 1]); + var lastDay = moment([year, month, daysInMonth]); + var lastMonth = moment(firstDay).subtract(1, 'month').month(); + var lastYear = moment(firstDay).subtract(1, 'month').year(); + var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + var dayOfWeek = firstDay.day(); + + //initialize a 6 rows x 7 columns array for the calendar + var calendar = []; + calendar.firstDay = firstDay; + calendar.lastDay = lastDay; + + for (var i = 0; i < 6; i++) { + calendar[i] = []; + } + + //populate the calendar with date objects + var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; + if (startDay > daysInLastMonth) + startDay -= 7; - if (typeof options.locale.toLabel === 'string') { - this.locale.toLabel = options.locale.toLabel; + if (dayOfWeek == this.locale.firstDay) + startDay = daysInLastMonth - 6; + + var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); + + var col, row; + for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) { + if (i > 0 && col % 7 === 0) { + col = 0; + row++; } + calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second); + curDate.hour(12); - if (typeof options.locale.weekLabel === 'string') { - this.locale.weekLabel = options.locale.weekLabel; + if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') { + calendar[row][col] = this.minDate.clone(); } - if (typeof options.locale.customRangeLabel === 'string') { - this.locale.customRangeLabel = options.locale.customRangeLabel; + if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') { + calendar[row][col] = this.maxDate.clone(); } + } - if (typeof options.opens === 'string') - this.opens = options.opens; + //make the calendar object available to hoverDate/clickDate + if (side == 'left') { + this.leftCalendar.calendar = calendar; + } else { + this.rightCalendar.calendar = calendar; + } - if (typeof options.drops === 'string') - this.drops = options.drops; + // + // Display the calendar + // - if (typeof options.showWeekNumbers === 'boolean') { - this.showWeekNumbers = options.showWeekNumbers; - } + var minDate = side == 'left' ? this.minDate : this.startDate; + var maxDate = this.maxDate; + var selected = side == 'left' ? this.startDate : this.endDate; + var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'}; - if (typeof options.buttonClasses === 'string') { - this.buttonClasses = [options.buttonClasses]; - } + var html = ''; + html += ''; + html += ''; - if (typeof options.buttonClasses === 'object') { - this.buttonClasses = options.buttonClasses; - } + // add empty cell for week number + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; - if (typeof options.showDropdowns === 'boolean') { - this.showDropdowns = options.showDropdowns; + if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) { + html += ''; + } else { + html += ''; } - if (typeof options.singleDatePicker === 'boolean') { - this.singleDatePicker = options.singleDatePicker; - if (this.singleDatePicker) { - this.endDate = this.startDate.clone(); + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + + if (this.showDropdowns) { + var currentMonth = calendar[1][1].month(); + var currentYear = calendar[1][1].year(); + var maxYear = (maxDate && maxDate.year()) || (currentYear + 5); + var minYear = (minDate && minDate.year()) || (currentYear - 50); + var inMinYear = currentYear == minYear; + var inMaxYear = currentYear == maxYear; + + var monthHtml = '"; - if (typeof options.timePicker === 'boolean') { - this.timePicker = options.timePicker; - } + var yearHtml = ''; - if (typeof options.timePickerSeconds === 'boolean') { - this.timePickerSeconds = options.timePickerSeconds; + dateHtml = monthHtml + yearHtml; } - if (typeof options.timePickerIncrement === 'number') { - this.timePickerIncrement = options.timePickerIncrement; + html += ''; + if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) { + html += ''; + } else { + html += ''; } - if (typeof options.timePicker12Hour === 'boolean') { - this.timePicker12Hour = options.timePicker12Hour; - } + html += ''; + html += ''; - if (typeof options.autoApply === 'boolean') { - this.autoApply = options.autoApply; - if (this.autoApply) - this.container.find('.applyBtn, .cancelBtn').addClass('hide'); - } + // add week number label + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; - // update day names order to firstDay - if (this.locale.firstDay != 0) { - var iterator = this.locale.firstDay; - while (iterator > 0) { - this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); - iterator--; + $.each(this.locale.daysOfWeek, function(index, dayOfWeek) { + html += ''; + }); + + html += ''; + html += ''; + html += ''; + + //adjust maxDate to reflect the dateLimit setting in order to + //grey out end dates beyond the dateLimit + if (this.endDate == null && this.dateLimit) { + var maxLimit = this.startDate.clone().add(this.dateLimit).endOf('day'); + if (!maxDate || maxLimit.isBefore(maxDate)) { + maxDate = maxLimit; } } - var start, end, range; + for (var row = 0; row < 6; row++) { + html += ''; + + // add week number + if (this.showWeekNumbers) + html += ''; + else if (this.showISOWeekNumbers) + html += ''; + + for (var col = 0; col < 7; col++) { + + var classes = []; + + //highlight today's date + if (calendar[row][col].isSame(new Date(), "day")) + classes.push('today'); + + //highlight weekends + if (calendar[row][col].isoWeekday() > 5) + classes.push('weekend'); + + //grey out the dates in other months displayed at beginning and end of this calendar + if (calendar[row][col].month() != calendar[1][1].month()) + classes.push('off'); + + //don't allow selection of dates before the minimum date + if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day')) + classes.push('off', 'disabled'); + + //don't allow selection of dates after the maximum date + if (maxDate && calendar[row][col].isAfter(maxDate, 'day')) + classes.push('off', 'disabled'); - //if no start/end dates set, check if an input element contains initial values - if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { - if ($(this.element).is('input[type=text]')) { - var val = $(this.element).val(), - split = val.split(this.separator); + //don't allow selection of date if a custom function decides it's invalid + if (this.isInvalidDate(calendar[row][col])) + classes.push('off', 'disabled'); - start = end = null; + //highlight the currently selected start date + if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) + classes.push('active', 'start-date'); - if (split.length == 2) { - start = moment(split[0], this.format); - end = moment(split[1], this.format); - } else if (this.singleDatePicker && val !== "") { - start = moment(val, this.format); - end = moment(val, this.format); + //highlight the currently selected end date + if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) + classes.push('active', 'end-date'); + + //highlight dates in-between the selected dates + if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate) + classes.push('in-range'); + + //apply custom classes for this date + var isCustom = this.isCustomDate(calendar[row][col]); + if (isCustom !== false) { + if (typeof isCustom === 'string') + classes.push(isCustom); + else + Array.prototype.push.apply(classes, isCustom); } - if (start !== null && end !== null) { - this.startDate = start; - this.endDate = end; + + var cname = '', disabled = false; + for (var i = 0; i < classes.length; i++) { + cname += classes[i] + ' '; + if (classes[i] == 'disabled') + disabled = true; } + if (!disabled) + cname += 'available'; + + html += ''; + } + html += ''; } - // bind the time zone used to build the calendar to either the timeZone passed in through the options or the zone of the startDate (which will be the local time zone by default) - if (typeof options.timeZone === 'string' || typeof options.timeZone === 'number') { - if (typeof options.timeZone === 'string' && typeof moment.tz !== 'undefined') { - this.timeZone = moment.tz.zone(options.timeZone).parse(new Date) * -1; // Offset is positive if the timezone is behind UTC and negative if it is ahead. - } else { - this.timeZone = options.timeZone; - } - this.startDate.utcOffset(this.timeZone); - this.endDate.utcOffset(this.timeZone); - } else { - this.timeZone = moment(this.startDate).utcOffset(); - } + html += ''; + html += '
' + dateHtml + '
' + this.locale.weekLabel + '' + dayOfWeek + '
' + calendar[row][0].week() + '' + calendar[row][0].isoWeek() + '' + calendar[row][col].date() + '
'; - if (typeof options.ranges === 'object') { - for (range in options.ranges) { - - if (typeof options.ranges[range][0] === 'string') - start = moment(options.ranges[range][0], this.format); - else - start = moment(options.ranges[range][0]); - - if (typeof options.ranges[range][1] === 'string') - end = moment(options.ranges[range][1], this.format); - else - end = moment(options.ranges[range][1]); - - // If we have a min/max date set, bound this range - // to it, but only if it would otherwise fall - // outside of the min/max. - if (this.minDate && start.isBefore(this.minDate)) - start = moment(this.minDate); - - if (this.maxDate && end.isAfter(this.maxDate)) - end = moment(this.maxDate); - - // If the end of the range is before the minimum (if min is set) OR - // the start of the range is after the max (also if set) don't display this - // range option. - if ((this.minDate && end.isBefore(this.minDate)) || (this.maxDate && start.isAfter(this.maxDate))) { - continue; - } + this.container.find('.calendar.' + side + ' .calendar-table').html(html); - this.ranges[range] = [start, end]; - } + }, - var list = ''; - this.container.find('.ranges ul').remove(); - this.container.find('.ranges').prepend(list); - } + renderTimePicker: function(side) { - if (typeof callback === 'function') { - this.cb = callback; - } + // Don't bother updating the time picker if it's currently disabled + // because an end date hasn't been clicked yet + if (side == 'right' && !this.endDate) return; - if (!this.timePicker) { - this.startDate = this.startDate.startOf('day'); - this.endDate = this.endDate.endOf('day'); - } + var html, selected, minDate, maxDate = this.maxDate; - if (this.singleDatePicker) { - this.opens = this.opens || 'right'; - this.container.addClass('single'); - this.container.find('.calendar.right').show(); - this.container.find('.calendar.left').hide(); - if (!this.timePicker) { - this.container.find('.ranges').hide(); - } else { - this.container.find('.ranges .daterangepicker_start_input, .ranges .daterangepicker_end_input').hide(); - } - if (!this.container.find('.calendar.right').hasClass('single')) - this.container.find('.calendar.right').addClass('single'); - } else { - this.container.removeClass('single'); - this.container.find('.calendar.right').removeClass('single'); - this.container.find('.ranges').show(); - } + if (this.dateLimit && (!this.maxDate || this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate))) + maxDate = this.startDate.clone().add(this.dateLimit); - this.oldStartDate = this.startDate.clone(); - this.oldEndDate = this.endDate.clone(); - this.oldChosenLabel = this.chosenLabel; - - this.leftCalendar = { - month: moment([this.startDate.year(), this.startDate.month(), 1, this.startDate.hour(), this.startDate.minute(), this.startDate.second()]), - calendar: [] - }; - - this.rightCalendar = { - month: moment([this.endDate.year(), this.endDate.month(), 1, this.endDate.hour(), this.endDate.minute(), this.endDate.second()]), - calendar: [] - }; - - if (this.opens == 'right' || this.opens == 'center') { - //swap calendar positions - var first = this.container.find('.calendar.first'); - var second = this.container.find('.calendar.second'); - - if (second.hasClass('single')) { - second.removeClass('single'); - first.addClass('single'); - } + if (side == 'left') { + selected = this.startDate.clone(); + minDate = this.minDate; + } else if (side == 'right') { + selected = this.endDate.clone(); + minDate = this.startDate; - first.removeClass('left').addClass('right'); - second.removeClass('right').addClass('left'); + //Preserve the time already selected + var timeSelector = this.container.find('.calendar.right .calendar-time div'); + if (timeSelector.html() != '') { + + selected.hour(timeSelector.find('.hourselect option:selected').val() || selected.hour()); + selected.minute(timeSelector.find('.minuteselect option:selected').val() || selected.minute()); + selected.second(timeSelector.find('.secondselect option:selected').val() || selected.second()); + + if (!this.timePicker24Hour) { + var ampm = timeSelector.find('.ampmselect option:selected').val(); + if (ampm === 'PM' && selected.hour() < 12) + selected.hour(selected.hour() + 12); + if (ampm === 'AM' && selected.hour() === 12) + selected.hour(0); + } - if (this.singleDatePicker) { - first.show(); - second.hide(); } - } - if (typeof options.ranges === 'undefined' && !this.singleDatePicker) { - this.container.addClass('show-calendar'); + if (selected.isBefore(this.startDate)) + selected = this.startDate.clone(); + + if (maxDate && selected.isAfter(maxDate)) + selected = maxDate.clone(); + } - this.container.removeClass('opensleft opensright').addClass('opens' + this.opens); + // + // hours + // - this.updateView(); - this.updateCalendars(); + html = ' '; - this.updateView(); - this.updateCalendars(); - this.updateInputText(); - }, + // + // minutes + // - setEndDate: function(endDate) { - if (typeof endDate === 'string') - this.endDate = moment(endDate, this.format).utcOffset(this.timeZone); + html += ': '; - updateView: function () { - this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()); - this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()); - this.updateFormInputs(); - }, + // + // seconds + // - updateFormInputs: function () { - this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.format)); - this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.format)); + if (this.timePickerSeconds) { + html += ': '; } - }, - updateFromControl: function () { - if (!this.element.is('input')) return; - if (!this.element.val().length) return; + // + // AM/PM + // - var dateString = this.element.val().split(this.separator), - start = null, - end = null; + if (!this.timePicker24Hour) { + html += ''; + } - if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) - this.notify(); + this.container.find('.calendar.' + side + ' .calendar-time div').html(html); - this.updateCalendars(); - }, - - keydown: function (e) { - //hide on tab or enter - if ((e.keyCode === 9) || (e.keyCode === 13)) { - this.hide(); - } }, - notify: function () { - this.updateView(); - this.updateInputText(); - this.cb(this.startDate, this.endDate, this.chosenLabel); + updateFormInputs: function() { + + //ignore mouse movements while an above-calendar text input has focus + if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + return; + + this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format)); + if (this.endDate) + this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format)); + + if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) { + this.container.find('button.applyBtn').removeAttr('disabled'); + } else { + this.container.find('button.applyBtn').attr('disabled', 'disabled'); + } + }, - move: function () { + move: function() { var parentOffset = { top: 0, left: 0 }, - containerTop; + containerTop; var parentRightEdge = $(window).width(); if (!this.parentEl.is('body')) { parentOffset = { @@ -572,11 +1047,11 @@ }; parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; } - + if (this.drops == 'up') - containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; + containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; else - containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; + containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup'); if (this.opens == 'left') { @@ -619,23 +1094,12 @@ } }, - toggle: function (e) { - if (this.element.hasClass('active')) { - this.hide(); - } else { - this.show(); - } - }, - - show: function (e) { + show: function(e) { if (this.isShowing) return; - this.element.addClass('active'); - this.container.show(); - this.move(); - // Create a click proxy that is private to this instance of datepicker, for unbinding - this._outsideClickProxy = $.proxy(function (e) { this.outsideClick(e); }, this); + this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this); + // Bind global datepicker mousedown for hiding and $(document) .on('mousedown.daterangepicker', this._outsideClickProxy) @@ -646,55 +1110,66 @@ // and also close when focus changes to outside the picker (eg. tabbing between controls) .on('focusin.daterangepicker', this._outsideClickProxy); - this.isShowing = true; - this.element.trigger('show.daterangepicker', this); - }, + // Reposition the picker if the window is resized while it's open + $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this)); - outsideClick: function (e) { - var target = $(e.target); - // if the page is clicked anywhere except within the daterangerpicker/button - // itself then call this.hide() - if ( - // ie modal dialog fix - e.type == "focusin" || - target.closest(this.element).length || - target.closest(this.container).length || - target.closest('.calendar-date').length - ) return; - this.hide(); + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + this.previousRightTime = this.endDate.clone(); + + this.updateView(); + this.container.show(); + this.move(); + this.element.trigger('show.daterangepicker', this); + this.isShowing = true; }, - hide: function (e) { + hide: function(e) { if (!this.isShowing) return; - $(document) - .off('.daterangepicker'); - - this.element.removeClass('active'); - this.container.hide(); + //incomplete date selection, revert to last values + if (!this.endDate) { + this.startDate = this.oldStartDate.clone(); + this.endDate = this.oldEndDate.clone(); + } + //if a new date range was selected, invoke the user callback function if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) - this.notify(); + this.callback(this.startDate, this.endDate, this.chosenLabel); - this.oldStartDate = this.startDate.clone(); - this.oldEndDate = this.endDate.clone(); + //if picker is attached to a text input, update it + this.updateElement(); - this.isShowing = false; + $(document).off('.daterangepicker'); + $(window).off('.daterangepicker'); + this.container.hide(); this.element.trigger('hide.daterangepicker', this); + this.isShowing = false; }, - enterRange: function (e) { - // mouse pointer has entered a range label - var label = e.target.innerHTML; - if (label == this.locale.customRangeLabel) { - this.updateView(); + toggle: function(e) { + if (this.isShowing) { + this.hide(); } else { - var dates = this.ranges[label]; - this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.format)); - this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.format)); + this.show(); } }, + outsideClick: function(e) { + var target = $(e.target); + // if the page is clicked anywhere except within the daterangerpicker/button + // itself then call this.hide() + if ( + // ie modal dialog fix + e.type == "focusin" || + target.closest(this.element).length || + target.closest(this.container).length || + target.closest('.calendar-table').length + ) return; + this.hide(); + this.element.trigger('outsideClick.daterangepicker', this); + }, + showCalendars: function() { this.container.addClass('show-calendar'); this.move(); @@ -703,63 +1178,34 @@ hideCalendars: function() { this.container.removeClass('show-calendar'); - this.element.trigger('hideCalendar.daterangepicker', this); - }, - - // when a date is typed into the start to end date textboxes - inputsChanged: function (e) { - var el = $(e.target); - var date = moment(el.val(), this.format); - if (!date.isValid()) return; - - var startDate, endDate; - if (el.attr('name') === 'daterangepicker_start') { - startDate = (false !== this.minDate && date.isBefore(this.minDate)) ? this.minDate : date; - endDate = this.endDate; - if (typeof this.dateLimit === 'object') { - var maxDate = moment(startDate).add(this.dateLimit).endOf('day'); - if (endDate.isAfter(maxDate)) { - endDate = maxDate; - } - } - } else { - startDate = this.startDate; - endDate = (false !== this.maxDate && date.isAfter(this.maxDate)) ? this.maxDate : date.endOf('day'); - if (typeof this.dateLimit === 'object') { - var minDate = moment(endDate).subtract(this.dateLimit).startOf('day'); - if (startDate.isBefore(minDate)) { - startDate = minDate; - } - } - } - this.setCustomDates(startDate, endDate); + this.element.trigger('hideCalendar.daterangepicker', this); }, - inputsKeydown: function(e) { - if (e.keyCode === 13) { - this.inputsChanged(e); - this.notify(); - } - }, + hoverRange: function(e) { - updateInputText: function() { - if (this.element.is('input') && !this.singleDatePicker) { - this.element.val(this.startDate.format(this.format) + this.separator + this.endDate.format(this.format)); - this.element.trigger('change'); - } else if (this.element.is('input')) { - this.element.val(this.endDate.format(this.format)); - this.element.trigger('change'); + //ignore mouse movements while an above-calendar text input has focus + if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + return; + + var label = e.target.getAttribute('data-range-key'); + + if (label == this.locale.customRangeLabel) { + this.updateView(); + } else { + var dates = this.ranges[label]; + this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format)); + this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format)); } + }, - clickRange: function (e) { - var label = e.target.innerHTML; + clickRange: function(e) { + var label = e.target.getAttribute('data-range-key'); this.chosenLabel = label; if (label == this.locale.customRangeLabel) { this.showCalendars(); } else { var dates = this.ranges[label]; - this.startDate = dates[0]; this.endDate = dates[1]; @@ -768,140 +1214,201 @@ this.endDate.endOf('day'); } - this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year()).hour(this.startDate.hour()).minute(this.startDate.minute()); - this.rightCalendar.month.month(this.endDate.month()).year(this.endDate.year()).hour(this.endDate.hour()).minute(this.endDate.minute()); - this.updateCalendars(); - - this.updateInputText(); - - this.hideCalendars(); - this.hide(); - this.element.trigger('apply.daterangepicker', this); - - if (this.autoApply) { - this.notify(); - } - + if (!this.alwaysShowCalendars) + this.hideCalendars(); + this.clickApply(); } }, - clickPrev: function (e) { + clickPrev: function(e) { var cal = $(e.target).parents('.calendar'); if (cal.hasClass('left')) { this.leftCalendar.month.subtract(1, 'month'); + if (this.linkedCalendars) + this.rightCalendar.month.subtract(1, 'month'); } else { this.rightCalendar.month.subtract(1, 'month'); } this.updateCalendars(); }, - clickNext: function (e) { + clickNext: function(e) { var cal = $(e.target).parents('.calendar'); if (cal.hasClass('left')) { this.leftCalendar.month.add(1, 'month'); } else { this.rightCalendar.month.add(1, 'month'); + if (this.linkedCalendars) + this.leftCalendar.month.add(1, 'month'); } this.updateCalendars(); }, - hoverDate: function (e) { + hoverDate: function(e) { + + //ignore mouse movements while an above-calendar text input has focus + //if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + // return; + + //ignore dates that can't be selected + if (!$(e.target).hasClass('available')) return; + + //have the text inputs above calendars reflect the date being hovered over var title = $(e.target).attr('data-title'); var row = title.substr(1, 1); var col = title.substr(3, 1); var cal = $(e.target).parents('.calendar'); + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; - if (cal.hasClass('left')) { - this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].format(this.format)); - } else { - this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].format(this.format)); + if (this.endDate && !this.container.find('input[name=daterangepicker_start]').is(":focus")) { + this.container.find('input[name=daterangepicker_start]').val(date.format(this.locale.format)); + } else if (!this.endDate && !this.container.find('input[name=daterangepicker_end]').is(":focus")) { + this.container.find('input[name=daterangepicker_end]').val(date.format(this.locale.format)); } - }, - setCustomDates: function(startDate, endDate) { - this.chosenLabel = this.locale.customRangeLabel; - if (startDate.isAfter(endDate)) { - var difference = this.endDate.diff(this.startDate); - endDate = moment(startDate).add(difference, 'ms'); - if (this.maxDate && endDate.isAfter(this.maxDate)) { - endDate = this.maxDate.clone(); - } - } - this.startDate = startDate; - this.endDate = endDate; + //highlight the dates between the start date and the date being hovered as a potential end date + var leftCalendar = this.leftCalendar; + var rightCalendar = this.rightCalendar; + var startDate = this.startDate; + if (!this.endDate) { + this.container.find('.calendar tbody td').each(function(index, el) { - this.updateView(); - this.updateCalendars(); + //skip week numbers, only look at dates + if ($(el).hasClass('week')) return; + + var title = $(el).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(el).parents('.calendar'); + var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col]; - if (this.autoApply) { - this.notify(); - this.element.trigger('apply.daterangepicker', this); + if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) { + $(el).addClass('in-range'); + } else { + $(el).removeClass('in-range'); + } + + }); } + }, - clickDate: function (e) { + clickDate: function(e) { + + if (!$(e.target).hasClass('available')) return; + var title = $(e.target).attr('data-title'); var row = title.substr(1, 1); var col = title.substr(3, 1); var cal = $(e.target).parents('.calendar'); - - var startDate, endDate; - if (cal.hasClass('left')) { - startDate = this.leftCalendar.calendar[row][col]; - endDate = this.endDate; - if (typeof this.dateLimit === 'object') { - var maxDate = moment(startDate).add(this.dateLimit).endOf('day'); - if (endDate.isAfter(maxDate)) { - endDate = maxDate; + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; + + // + // this function needs to do a few things: + // * alternate between selecting a start and end date for the range, + // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date + // * if autoapply is enabled, and an end date was chosen, apply the selection + // * if single date picker mode, and time picker isn't enabled, apply the selection immediately + // * if one of the inputs above the calendars was focused, cancel that manual input + // + + if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start + if (this.timePicker) { + var hour = parseInt(this.container.find('.left .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; } + var minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); } - } else { - startDate = this.startDate; - endDate = this.rightCalendar.calendar[row][col]; - if (typeof this.dateLimit === 'object') { - var minDate = moment(endDate).subtract(this.dateLimit).startOf('day'); - if (startDate.isBefore(minDate)) { - startDate = minDate; + this.endDate = null; + this.setStartDate(date.clone()); + } else if (!this.endDate && date.isBefore(this.startDate)) { + //special case: clicking the same date for start/end, + //but the time of the end date is before the start date + this.setEndDate(this.startDate.clone()); + } else { // picking end + if (this.timePicker) { + var hour = parseInt(this.container.find('.right .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; } + var minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); + } + this.setEndDate(date.clone()); + if (this.autoApply) { + this.calculateChosenLabel(); + this.clickApply(); } } - if (this.singleDatePicker && cal.hasClass('left')) { - endDate = startDate.clone(); - } else if (this.singleDatePicker && cal.hasClass('right')) { - startDate = endDate.clone(); + if (this.singleDatePicker) { + this.setEndDate(this.startDate); + if (!this.timePicker) + this.clickApply(); } - cal.find('td').removeClass('active'); - - $(e.target).addClass('active'); + this.updateView(); - this.setCustomDates(startDate, endDate); + //This is to cancel the blur event handler if the mouse was in one of the inputs + e.stopPropagation(); - if (!this.timePicker) - endDate.endOf('day'); + }, - if (this.singleDatePicker && !this.timePicker) - this.clickApply(); + calculateChosenLabel: function () { + var customRange = true; + var i = 0; + for (var range in this.ranges) { + if (this.timePicker) { + if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').html(); + break; + } + } else { + //ignore times when comparing dates if time picker is not enabled + if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').html(); + break; + } + } + i++; + } + if (customRange) { + if (this.showCustomRangeLabel) { + this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html(); + } else { + this.chosenLabel = null; + } + this.showCalendars(); + } }, - clickApply: function (e) { - this.updateInputText(); + clickApply: function(e) { this.hide(); this.element.trigger('apply.daterangepicker', this); }, - clickCancel: function (e) { + clickCancel: function(e) { this.startDate = this.oldStartDate; this.endDate = this.oldEndDate; - this.chosenLabel = this.oldChosenLabel; - this.updateView(); - this.updateCalendars(); this.hide(); this.element.trigger('cancel.daterangepicker', this); }, - updateMonthYear: function (e) { + monthOrYearChanged: function(e) { var isLeft = $(e.target).closest('.calendar').hasClass('left'), leftOrRight = isLeft ? 'left' : 'right', cal = this.container.find('.calendar.'+leftOrRight); @@ -910,7 +1417,7 @@ var month = parseInt(cal.find('.monthselect').val(), 10); var year = cal.find('.yearselect').val(); - if (!isLeft && !this.singleDatePicker) { + if (!isLeft) { if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) { month = this.startDate.month(); year = this.startDate.year(); @@ -931,25 +1438,28 @@ } } - - this[leftOrRight+'Calendar'].month.month(month).year(year); + if (isLeft) { + this.leftCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month'); + } else { + this.rightCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month'); + } this.updateCalendars(); }, - updateTime: function(e) { + timeChanged: function(e) { var cal = $(e.target).closest('.calendar'), isLeft = cal.hasClass('left'); var hour = parseInt(cal.find('.hourselect').val(), 10); var minute = parseInt(cal.find('.minuteselect').val(), 10); - var second = 0; - - if (this.timePickerSeconds) { - second = parseInt(cal.find('.secondselect').val(), 10); - } + var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0; - if (this.timePicker12Hour) { + if (!this.timePicker24Hour) { var ampm = cal.find('.ampmselect').val(); if (ampm === 'PM' && hour < 12) hour += 12; @@ -962,387 +1472,155 @@ start.hour(hour); start.minute(minute); start.second(second); - this.startDate = start; - this.leftCalendar.month.hour(hour).minute(minute).second(second); - if (this.singleDatePicker) - this.endDate = start.clone(); - } else { + this.setStartDate(start); + if (this.singleDatePicker) { + this.endDate = this.startDate.clone(); + } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) { + this.setEndDate(start.clone()); + } + } else if (this.endDate) { var end = this.endDate.clone(); end.hour(hour); end.minute(minute); end.second(second); - this.endDate = end; - if (this.singleDatePicker) - this.startDate = end.clone(); - this.rightCalendar.month.hour(hour).minute(minute).second(second); + this.setEndDate(end); } - this.updateView(); + //update the calendars so all clickable dates reflect the new time component this.updateCalendars(); - if (this.autoApply) { - this.notify(); - this.element.trigger('apply.daterangepicker', this); - } - }, + //update the form inputs above the calendars with the new time + this.updateFormInputs(); - updateCalendars: function () { - this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.month(), this.leftCalendar.month.year(), this.leftCalendar.month.hour(), this.leftCalendar.month.minute(), this.leftCalendar.month.second(), 'left'); - this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.month(), this.rightCalendar.month.year(), this.rightCalendar.month.hour(), this.rightCalendar.month.minute(), this.rightCalendar.month.second(), 'right'); - this.container.find('.calendar.left').empty().html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate, 'left')); - this.container.find('.calendar.right').empty().html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.singleDatePicker ? this.minDate : this.startDate, this.maxDate, 'right')); + //re-render the time pickers because changing one selection can affect what's enabled in another + this.renderTimePicker('left'); + this.renderTimePicker('right'); - this.container.find('.ranges li').removeClass('active'); - var customRange = true; - var i = 0; - for (var range in this.ranges) { - if (this.timePicker) { - if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) { - customRange = false; - this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')') - .addClass('active').html(); - } - } else { - //ignore times when comparing dates if time picker is not enabled - if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { - customRange = false; - this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')') - .addClass('active').html(); - } - } - i++; - } - if (customRange) { - this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html(); - this.showCalendars(); - } }, - buildCalendar: function (month, year, hour, minute, second, side) { - var daysInMonth = moment([year, month]).daysInMonth(); - var firstDay = moment([year, month, 1]); - var lastDay = moment([year, month, daysInMonth]); - var lastMonth = moment(firstDay).subtract(1, 'month').month(); - var lastYear = moment(firstDay).subtract(1, 'month').year(); + formInputsChanged: function(e) { + var isRight = $(e.target).closest('.calendar').hasClass('right'); + var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format); + var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format); - var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + if (start.isValid() && end.isValid()) { - var dayOfWeek = firstDay.day(); + if (isRight && end.isBefore(start)) + start = end.clone(); - var i; + this.setStartDate(start); + this.setEndDate(end); - //initialize a 6 rows x 7 columns array for the calendar - var calendar = []; - calendar.firstDay = firstDay; - calendar.lastDay = lastDay; + if (isRight) { + this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)); + } else { + this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format)); + } - for (i = 0; i < 6; i++) { - calendar[i] = []; } - //populate the calendar with date objects - var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; - if (startDay > daysInLastMonth) - startDay -= 7; - - if (dayOfWeek == this.locale.firstDay) - startDay = daysInLastMonth - 6; - - // Possible patch for issue #626 https://github.com/dangrossman/bootstrap-daterangepicker/issues/626 - var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); // .utcOffset(this.timeZone); - - var col, row; - for (i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) { - if (i > 0 && col % 7 === 0) { - col = 0; - row++; - } - calendar[row][col] = curDate.clone().hour(hour); - curDate.hour(12); + this.updateView(); + }, - if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') { - calendar[row][col] = this.minDate.clone(); - } + formInputsFocused: function(e) { - if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') { - calendar[row][col] = this.maxDate.clone(); - } + // Highlight the focused input + this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active'); + $(e.target).addClass('active'); + // Set the state such that if the user goes back to using a mouse, + // the calendars are aware we're selecting the end of the range, not + // the start. This allows someone to edit the end of a date range without + // re-selecting the beginning, by clicking on the end date input then + // using the calendar. + var isRight = $(e.target).closest('.calendar').hasClass('right'); + if (isRight) { + this.endDate = null; + this.setStartDate(this.startDate.clone()); + this.updateView(); } - return calendar; }, - renderDropdowns: function (selected, minDate, maxDate) { - var currentMonth = selected.month(); - var currentYear = selected.year(); - var maxYear = (maxDate && maxDate.year()) || (currentYear + 5); - var minYear = (minDate && minDate.year()) || (currentYear - 50); - - var monthHtml = '"; + formInputsBlurred: function(e) { - var yearHtml = ''; - - return monthHtml + yearHtml; }, - renderCalendar: function (calendar, selected, minDate, maxDate, side) { - - var html = '
'; - html += ''; - html += ''; - html += ''; - - // add empty cell for week number - if (this.showWeekNumbers) - html += ''; - - if (!minDate || minDate.isBefore(calendar.firstDay)) { - html += ''; - } else { - html += ''; - } + elementChanged: function() { + if (!this.element.is('input')) return; + if (!this.element.val().length) return; + if (this.element.val().length < this.locale.format.length) return; - var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + var dateString = this.element.val().split(this.locale.separator), + start = null, + end = null; - if (this.showDropdowns) { - dateHtml = this.renderDropdowns(calendar[1][1], minDate, maxDate); + if (dateString.length === 2) { + start = moment(dateString[0], this.locale.format); + end = moment(dateString[1], this.locale.format); } - html += ''; - if (!maxDate || maxDate.isAfter(calendar.lastDay)) { - html += ''; - } else { - html += ''; + if (this.singleDatePicker || start === null || end === null) { + start = moment(this.element.val(), this.locale.format); + end = start; } - html += ''; - html += ''; - - // add week number label - if (this.showWeekNumbers) - html += ''; - - $.each(this.locale.daysOfWeek, function (index, dayOfWeek) { - html += ''; - }); - - html += ''; - html += ''; - html += ''; - - for (var row = 0; row < 6; row++) { - html += ''; - - // add week number - if (this.showWeekNumbers) - html += ''; - - for (var col = 0; col < 7; col++) { - var cname = 'available '; - cname += (calendar[row][col].month() == calendar[1][1].month()) ? '' : 'off'; - - if(calendar[row][col].isSame(new Date(), "day") ) { - cname += ' today '; - } + if (!start.isValid() || !end.isValid()) return; - if ((minDate && calendar[row][col].isBefore(minDate, 'day')) || (maxDate && calendar[row][col].isAfter(maxDate, 'day'))) { - cname = ' off disabled '; - } else if (calendar[row][col].format('YYYY-MM-DD') == selected.format('YYYY-MM-DD')) { - cname += ' active '; - if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) { - cname += ' start-date '; - } - if (calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) { - cname += ' end-date '; - } - } else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate) { - cname += ' in-range '; - if (calendar[row][col].isSame(this.startDate)) { cname += ' start-date '; } - if (calendar[row][col].isSame(this.endDate)) { cname += ' end-date '; } - } + this.setStartDate(start); + this.setEndDate(end); + this.updateView(); + }, - var title = 'r' + row + 'c' + col; - html += ''; - } - html += ''; + keydown: function(e) { + //hide on tab or enter + if ((e.keyCode === 9) || (e.keyCode === 13)) { + this.hide(); } + }, - html += ''; - html += '
' + dateHtml + '
' + this.locale.weekLabel + '' + dayOfWeek + '
' + calendar[row][0].week() + '' + calendar[row][col].date() + '
'; - html += '
'; - - var i; - if (this.timePicker) { - - html += '
'; - html += ' : '; - - html += ' '; - - if (this.timePickerSeconds) { - html += ': '; - } - - if (this.timePicker12Hour) { - html += ''; - } - - html += '
'; - + updateElement: function() { + if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.element.trigger('change'); + } else if (this.element.is('input') && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format)); + this.element.trigger('change'); } - - return html; - }, remove: function() { - this.container.remove(); this.element.off('.daterangepicker'); - this.element.removeData('daterangepicker'); - + this.element.removeData(); } }; - $.fn.daterangepicker = function (options, cb) { - this.each(function () { + $.fn.daterangepicker = function(options, callback) { + this.each(function() { var el = $(this); if (el.data('daterangepicker')) el.data('daterangepicker').remove(); - el.data('daterangepicker', new DateRangePicker(el, options, cb)); + el.data('daterangepicker', new DateRangePicker(el, options, callback)); }); return this; }; + return DateRangePicker; + })); diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/examples.html b/app/Resources/public/assets/bootstrap-daterangepicker/examples.html deleted file mode 100644 index c7a491d2e4..0000000000 --- a/app/Resources/public/assets/bootstrap-daterangepicker/examples.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - A date range picker for Bootstrap - - - - - - - - - - -
-
- -

Usage Examples

- -
- -

Basic Date Range Picker

-
- -
-
-
-
-
- -
-
-
-
-
- - - -
- - -

Basic Single Date Picker

-
- -
-
-
-
-
- -
-
-
-
-
- - - -
- -

Date Range & Time Picker with 30 Minute Increments

-
- -
-
-
- -
-
- - -
-
-
-
-
- - - -
- -

Options Usage

- -
- - - - - - - -
- - -
- - - -
- - -

Plays nicely with Bootstrap dropdowns

- -
- - - -
- - -
- - - -
- - -

And also can drop "up"

- -
- -
-
-
-
-
- -
-
-
-
-
- - - -
- - -
-
- - - diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/package.js b/app/Resources/public/assets/bootstrap-daterangepicker/package.js index 22f2055b03..b89a2d6cae 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/package.js +++ b/app/Resources/public/assets/bootstrap-daterangepicker/package.js @@ -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"]); }); diff --git a/app/Resources/public/assets/bootstrap-daterangepicker/package.json b/app/Resources/public/assets/bootstrap-daterangepicker/package.json index 5ba5a7aef7..9f915f8f47 100644 --- a/app/Resources/public/assets/bootstrap-daterangepicker/package.json +++ b/app/Resources/public/assets/bootstrap-daterangepicker/package.json @@ -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" } } diff --git a/bower.json b/bower.json index f99c9d9ca1..f716b2fa1a 100644 --- a/bower.json +++ b/bower.json @@ -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.*", diff --git a/composer.lock b/composer.lock index 673ed53d54..c11acd4287 100644 --- a/composer.lock +++ b/composer.lock @@ -297,16 +297,16 @@ }, { "name": "alchemy/zippy", - "version": "0.4.7", + "version": "0.4.8", "source": { "type": "git", "url": "https://github.com/alchemy-fr/Zippy.git", - "reference": "06a818f8aaca096aad5b5d6c6c7208465282a103" + "reference": "2c231a0956daa0fa1e6057d411504ff98717392e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/06a818f8aaca096aad5b5d6c6c7208465282a103", - "reference": "06a818f8aaca096aad5b5d6c6c7208465282a103", + "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/2c231a0956daa0fa1e6057d411504ff98717392e", + "reference": "2c231a0956daa0fa1e6057d411504ff98717392e", "shasum": "" }, "require": { @@ -357,7 +357,7 @@ "tar", "zip" ], - "time": "2017-02-23T17:37:12+00:00" + "time": "2017-03-03T08:42:32+00:00" }, { "name": "behat/transliterator", @@ -1364,12 +1364,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "e46858e487cba3df09ed3305612b0179da2fe8cf" + "reference": "d7101c827c8dbf0f05767c62f834e50f62d26b45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/e46858e487cba3df09ed3305612b0179da2fe8cf", - "reference": "e46858e487cba3df09ed3305612b0179da2fe8cf", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/d7101c827c8dbf0f05767c62f834e50f62d26b45", + "reference": "d7101c827c8dbf0f05767c62f834e50f62d26b45", "shasum": "" }, "require": { @@ -1430,7 +1430,7 @@ "database", "migrations" ], - "time": "2017-02-14 11:16:09" + "time": "2017-03-01 08:40:41" }, { "name": "doctrine/orm", @@ -2177,21 +2177,25 @@ }, { "name": "jimmiw/php-time-ago", - "version": "0.4.14", + "version": "0.4.15", "source": { "type": "git", "url": "https://github.com/jimmiw/php-time-ago.git", - "reference": "80178cac870260b5297330ba38354af7eae0e342" + "reference": "2bd8b75d3034b9ce996f96bee8c38e79525f6758" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jimmiw/php-time-ago/zipball/80178cac870260b5297330ba38354af7eae0e342", - "reference": "80178cac870260b5297330ba38354af7eae0e342", + "url": "https://api.github.com/repos/jimmiw/php-time-ago/zipball/2bd8b75d3034b9ce996f96bee8c38e79525f6758", + "reference": "2bd8b75d3034b9ce996f96bee8c38e79525f6758", "shasum": "" }, "require": { "php": ">=4" }, + "require-dev": { + "phpunit/dbunit": "2.0.*", + "phpunit/phpunit": "5.*@stable" + }, "type": "library", "autoload": { "files": [ @@ -2216,7 +2220,7 @@ "time ago", "time ago in words" ], - "time": "2016-09-22T08:40:33+00:00" + "time": "2017-03-01T05:38:41+00:00" }, { "name": "justinrainbow/json-schema", @@ -3016,16 +3020,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.4", + "version": "v2.0.9", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e" + "reference": "6968531206671f94377b01dc7888d5d1b858a01b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", - "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/6968531206671f94377b01dc7888d5d1b858a01b", + "reference": "6968531206671f94377b01dc7888d5d1b858a01b", "shasum": "" }, "require": { @@ -3060,7 +3064,7 @@ "pseudorandom", "random" ], - "time": "2016-11-07T23:38:38+00:00" + "time": "2017-03-03T20:43:42+00:00" }, { "name": "patchwork/utf8", @@ -3814,21 +3818,24 @@ }, { "name": "seld/jsonlint", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "19495c181d6d53a0a13414154e52817e3b504189" + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/19495c181d6d53a0a13414154e52817e3b504189", - "reference": "19495c181d6d53a0a13414154e52817e3b504189", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/791f8c594f300d246cdf01c6b3e1e19611e301d8", + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8", "shasum": "" }, "require": { "php": "^5.3 || ^7.0" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "bin": [ "bin/jsonlint" ], @@ -3856,7 +3863,7 @@ "parser", "validator" ], - "time": "2016-11-14T17:59:58+00:00" + "time": "2017-03-06T16:42:24+00:00" }, { "name": "seld/phar-utils", @@ -4050,16 +4057,16 @@ }, { "name": "sonata-project/block-bundle", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/sonata-project/SonataBlockBundle.git", - "reference": "3d8d6c3a4945035f4856ae41ab282bb225f4652d" + "reference": "f5aaddf91a862a10d0d79fc040dde5c16ae5f5f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sonata-project/SonataBlockBundle/zipball/3d8d6c3a4945035f4856ae41ab282bb225f4652d", - "reference": "3d8d6c3a4945035f4856ae41ab282bb225f4652d", + "url": "https://api.github.com/repos/sonata-project/SonataBlockBundle/zipball/f5aaddf91a862a10d0d79fc040dde5c16ae5f5f2", + "reference": "f5aaddf91a862a10d0d79fc040dde5c16ae5f5f2", "shasum": "" }, "require": { @@ -4118,7 +4125,7 @@ "block", "sonata" ], - "time": "2017-01-17T11:56:59+00:00" + "time": "2017-02-28T13:40:00+00:00" }, { "name": "sonata-project/cache", @@ -5104,16 +5111,16 @@ }, { "name": "symfony/class-loader", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "4f6bbee7b69ee53c19ea02f08914a8278b3fa877" + "reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/4f6bbee7b69ee53c19ea02f08914a8278b3fa877", - "reference": "4f6bbee7b69ee53c19ea02f08914a8278b3fa877", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/2c8de07a8a4cc4da9c018ab7a81888b80e762f93", + "reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93", "shasum": "" }, "require": { @@ -5121,7 +5128,7 @@ "symfony/polyfill-apcu": "~1.1" }, "require-dev": { - "symfony/finder": "~2.0,>=2.0.5|~3.0.0" + "symfony/finder": "^2.0.5|~3.0.0" }, "type": "library", "extra": { @@ -5153,20 +5160,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-01-21T16:40:50+00:00" + "time": "2017-02-18T19:13:35+00:00" }, { "name": "symfony/config", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "747fa191136cf798409183c501435aa4c16184df" + "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/747fa191136cf798409183c501435aa4c16184df", - "reference": "747fa191136cf798409183c501435aa4c16184df", + "url": "https://api.github.com/repos/symfony/config/zipball/06ce6bb46c24963ec09323da45d0f4f85d3cecd2", + "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2", "shasum": "" }, "require": { @@ -5209,25 +5216,25 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-02-05T10:11:19+00:00" + "time": "2017-03-01T18:13:50+00:00" }, { "name": "symfony/console", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4" + "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4", - "reference": "f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4", + "url": "https://api.github.com/repos/symfony/console/zipball/81508e6fac4476771275a3f4f53c3fee9b956bfa", + "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/debug": "~2.7,>=2.7.2|~3.0.0", + "symfony/debug": "^2.7.2|~3.0.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -5270,20 +5277,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:06+00:00" + "time": "2017-03-04T11:00:12+00:00" }, { "name": "symfony/debug", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "4a99c3a6cabfa0c297fc3531e61483d276133110" + "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/4a99c3a6cabfa0c297fc3531e61483d276133110", - "reference": "4a99c3a6cabfa0c297fc3531e61483d276133110", + "url": "https://api.github.com/repos/symfony/debug/zipball/e90099a2958d4833a02d05b504cc06e1c234abcc", + "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc", "shasum": "" }, "require": { @@ -5295,7 +5302,7 @@ }, "require-dev": { "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2|~3.0.0" + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" }, "type": "library", "extra": { @@ -5327,20 +5334,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-27T23:54:58+00:00" + "time": "2017-02-18T19:13:35+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1dfbf6a9e30113a9c4e482ab056e969c70c37a19" + "reference": "efdbeefa454a41154fd99a6f0489f0e9cb46c497" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1dfbf6a9e30113a9c4e482ab056e969c70c37a19", - "reference": "1dfbf6a9e30113a9c4e482ab056e969c70c37a19", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/efdbeefa454a41154fd99a6f0489f0e9cb46c497", + "reference": "efdbeefa454a41154fd99a6f0489f0e9cb46c497", "shasum": "" }, "require": { @@ -5390,20 +5397,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-01-27T23:54:58+00:00" + "time": "2017-02-28T12:31:05+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "0fbb39510182593885da1f731d9119ace42b7d27" + "reference": "742bac3009bbaff82ecb72f4ffa7e5a0507084a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/0fbb39510182593885da1f731d9119ace42b7d27", - "reference": "0fbb39510182593885da1f731d9119ace42b7d27", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/742bac3009bbaff82ecb72f4ffa7e5a0507084a7", + "reference": "742bac3009bbaff82ecb72f4ffa7e5a0507084a7", "shasum": "" }, "require": { @@ -5411,20 +5418,23 @@ "php": ">=5.3.9", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, "require-dev": { "doctrine/data-fixtures": "1.0.*", "doctrine/dbal": "~2.4", - "doctrine/orm": "~2.4,>=2.4.5", + "doctrine/orm": "^2.4.5", "symfony/dependency-injection": "~2.2|~3.0.0", "symfony/expression-language": "~2.2|~3.0.0", - "symfony/form": "~2.8.5|~3.0.5", + "symfony/form": "^2.8.18|~3.2.5", "symfony/http-kernel": "~2.2|~3.0.0", "symfony/property-access": "~2.3|~3.0.0", "symfony/property-info": "~2.8|3.0", "symfony/security": "~2.2|~3.0.0", "symfony/stopwatch": "~2.2|~3.0.0", - "symfony/translation": "~2.0,>=2.0.5|~3.0.0", - "symfony/validator": "~2.5,>=2.5.5|~3.0.0" + "symfony/translation": "^2.0.5|~3.0.0", + "symfony/validator": "~2.7.25|^2.8.18|~3.2.5" }, "suggest": { "doctrine/data-fixtures": "", @@ -5464,20 +5474,20 @@ ], "description": "Symfony Doctrine Bridge", "homepage": "https://symfony.com", - "time": "2017-01-27T23:54:58+00:00" + "time": "2017-03-05T17:40:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "74877977f90fb9c3e46378d5764217c55f32df34" + "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74877977f90fb9c3e46378d5764217c55f32df34", - "reference": "74877977f90fb9c3e46378d5764217c55f32df34", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bb4ec47e8e109c1c1172145732d0aa468d967cd0", + "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0", "shasum": "" }, "require": { @@ -5485,7 +5495,7 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/config": "^2.0.5|~3.0.0", "symfony/dependency-injection": "~2.6|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0" @@ -5524,7 +5534,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:30:24+00:00" + "time": "2017-02-21T08:33:48+00:00" }, { "name": "symfony/expression-language", @@ -5578,16 +5588,16 @@ }, { "name": "symfony/filesystem", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5b77d49ab76e5b12743b359ef4b4a712e6f5360d" + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5b77d49ab76e5b12743b359ef4b4a712e6f5360d", - "reference": "5b77d49ab76e5b12743b359ef4b4a712e6f5360d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e542d4765092d22552b1bf01ddccfb01d98ee325", + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325", "shasum": "" }, "require": { @@ -5623,20 +5633,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:43:03+00:00" + "time": "2017-02-18T17:06:33+00:00" }, { "name": "symfony/finder", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "355fccac526522dc5fca8ecf0e62749a149f3b8b" + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/355fccac526522dc5fca8ecf0e62749a149f3b8b", - "reference": "355fccac526522dc5fca8ecf0e62749a149f3b8b", + "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451", "shasum": "" }, "require": { @@ -5672,43 +5682,44 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:30:24+00:00" + "time": "2017-02-21T08:33:48+00:00" }, { "name": "symfony/form", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "724b4a84b3b81800fde85703749ac2b8fc84c651" + "reference": "8365cd65c776b62c3d09b0e42336740a02383f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/724b4a84b3b81800fde85703749ac2b8fc84c651", - "reference": "724b4a84b3b81800fde85703749ac2b8fc84c651", + "url": "https://api.github.com/repos/symfony/form/zipball/8365cd65c776b62c3d09b0e42336740a02383f78", + "reference": "8365cd65c776b62c3d09b0e42336740a02383f78", "shasum": "" }, "require": { "php": ">=5.3.9", "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/intl": "~2.4|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", "symfony/options-resolver": "~2.6", "symfony/polyfill-mbstring": "~1.0", "symfony/property-access": "~2.3|~3.0.0" }, "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "symfony/doctrine-bridge": "<2.7", "symfony/framework-bundle": "<2.7", "symfony/twig-bridge": "<2.7" }, "require-dev": { "doctrine/collections": "~1.0", - "symfony/dependency-injection": "~2.3|~3.0.0", + "symfony/dependency-injection": "~2.7|~3.0.0", "symfony/http-foundation": "~2.2|~3.0.0", "symfony/http-kernel": "~2.4|~3.0.0", "symfony/security-csrf": "~2.4|~3.0.0", - "symfony/translation": "~2.0,>=2.0.5|~3.0.0", - "symfony/validator": "~2.8|~3.0.0" + "symfony/translation": "^2.0.5|~3.0.0", + "symfony/validator": "^2.8.18|~3.2.5" }, "suggest": { "symfony/framework-bundle": "For templating with PHP.", @@ -5746,20 +5757,20 @@ ], "description": "Symfony Form Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:27:13+00:00" + "time": "2017-03-05T19:52:29+00:00" }, { "name": "symfony/framework-bundle", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "1c6bf2f6bf0e960881aedf99b9bba88b6f2c5810" + "reference": "865ff951f142c69422134214786bed43aaf53caf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/1c6bf2f6bf0e960881aedf99b9bba88b6f2c5810", - "reference": "1c6bf2f6bf0e960881aedf99b9bba88b6f2c5810", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/865ff951f142c69422134214786bed43aaf53caf", + "reference": "865ff951f142c69422134214786bed43aaf53caf", "shasum": "" }, "require": { @@ -5772,32 +5783,35 @@ "symfony/dependency-injection": "~2.8", "symfony/event-dispatcher": "~2.8|~3.0.0", "symfony/filesystem": "~2.3|~3.0.0", - "symfony/finder": "~2.0,>=2.0.5|~3.0.0", + "symfony/finder": "^2.0.5|~3.0.0", "symfony/http-foundation": "~2.7", - "symfony/http-kernel": "~2.8.16", + "symfony/http-kernel": "^2.8.18", "symfony/polyfill-mbstring": "~1.0", - "symfony/routing": "~2.8.17", + "symfony/routing": "^2.8.17", "symfony/security-core": "~2.6.13|~2.7.9|~2.8|~3.0.0", "symfony/security-csrf": "~2.6|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0", "symfony/templating": "~2.1|~3.0.0", "symfony/translation": "~2.8" }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, "require-dev": { "phpdocumentor/reflection": "^1.0.7", "sensio/framework-extra-bundle": "^3.0.2", "symfony/browser-kit": "~2.4|~3.0.0", "symfony/console": "~2.8.8|~3.0.8", - "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", - "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0", + "symfony/css-selector": "^2.0.5|~3.0.0", + "symfony/dom-crawler": "^2.0.5|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", - "symfony/form": "^2.8.16", + "symfony/form": "^2.8.18", "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "~2.0,>=2.0.5|~3.0.0", + "symfony/process": "^2.0.5|~3.0.0", "symfony/property-info": "~2.8|~3.0.0", "symfony/security": "~2.6|~3.0.0", "symfony/validator": "~2.5|~3.0.0", - "symfony/yaml": "~2.0,>=2.0.5|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.0", "twig/twig": "~1.23|~2.0" }, "suggest": { @@ -5839,20 +5853,20 @@ ], "description": "Symfony FrameworkBundle", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:06+00:00" + "time": "2017-03-02T21:33:27+00:00" }, { "name": "symfony/http-foundation", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "37658106408cbde9617b41ddca633a22823ca45e" + "reference": "88af747e7af17d8d7d439ad4639dc3e23ddd3edd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/37658106408cbde9617b41ddca633a22823ca45e", - "reference": "37658106408cbde9617b41ddca633a22823ca45e", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/88af747e7af17d8d7d439ad4639dc3e23ddd3edd", + "reference": "88af747e7af17d8d7d439ad4639dc3e23ddd3edd", "shasum": "" }, "require": { @@ -5894,27 +5908,27 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-02-02T13:38:20+00:00" + "time": "2017-03-04T12:20:59+00:00" }, { "name": "symfony/http-kernel", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "b594d828fa2b364e8ad2cea750aca9e613d57ac8" + "reference": "18d7a01ac14ffa5a652a635c402b9777f858fc1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b594d828fa2b364e8ad2cea750aca9e613d57ac8", - "reference": "b594d828fa2b364e8ad2cea750aca9e613d57ac8", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/18d7a01ac14ffa5a652a635c402b9777f858fc1a", + "reference": "18d7a01ac14ffa5a652a635c402b9777f858fc1a", "shasum": "" }, "require": { "php": ">=5.3.9", "psr/log": "~1.0", - "symfony/debug": "~2.6,>=2.6.2", - "symfony/event-dispatcher": "~2.6,>=2.6.7|~3.0.0", + "symfony/debug": "^2.6.2", + "symfony/event-dispatcher": "^2.6.7|~3.0.0", "symfony/http-foundation": "~2.7.20|~2.8.13|~3.1.6" }, "conflict": { @@ -5925,16 +5939,16 @@ "symfony/class-loader": "~2.1|~3.0.0", "symfony/config": "~2.8", "symfony/console": "~2.3|~3.0.0", - "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", + "symfony/css-selector": "^2.0.5|~3.0.0", "symfony/dependency-injection": "~2.8|~3.0.0", - "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0", + "symfony/dom-crawler": "^2.0.5|~3.0.0", "symfony/expression-language": "~2.4|~3.0.0", - "symfony/finder": "~2.0,>=2.0.5|~3.0.0", - "symfony/process": "~2.0,>=2.0.5|~3.0.0", + "symfony/finder": "^2.0.5|~3.0.0", + "symfony/process": "^2.0.5|~3.0.0", "symfony/routing": "~2.8|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0", "symfony/templating": "~2.2|~3.0.0", - "symfony/translation": "~2.0,>=2.0.5|~3.0.0", + "symfony/translation": "^2.0.5|~3.0.0", "symfony/var-dumper": "~2.6|~3.0.0" }, "suggest": { @@ -5976,28 +5990,29 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:47:36+00:00" + "time": "2017-03-06T03:54:35+00:00" }, { "name": "symfony/intl", - "version": "v3.0.9", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "d360e43fe5a17a75983a473c3acafaf45fd25cd6" + "reference": "aa4be25dd37cf05bf6cc33d2aec5e85faa9ca830" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/d360e43fe5a17a75983a473c3acafaf45fd25cd6", - "reference": "d360e43fe5a17a75983a473c3acafaf45fd25cd6", + "url": "https://api.github.com/repos/symfony/intl/zipball/aa4be25dd37cf05bf6cc33d2aec5e85faa9ca830", + "reference": "aa4be25dd37cf05bf6cc33d2aec5e85faa9ca830", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/polyfill-intl-icu": "~1.0" + "php": ">=5.3.9", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/polyfill-php54": "~1.0" }, "require-dev": { - "symfony/filesystem": "~2.8|~3.0" + "symfony/filesystem": "~2.1|~3.0.0" }, "suggest": { "ext-intl": "to use the component with locales other than \"en\"" @@ -6005,7 +6020,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.8-dev" } }, "autoload": { @@ -6051,20 +6066,20 @@ "l10n", "localization" ], - "time": "2016-07-30T07:22:48+00:00" + "time": "2017-03-05T17:40:13+00:00" }, { "name": "symfony/options-resolver", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc343e8e30e0e9785a0871196af722665d8b970e" + "reference": "bbaa4927a6edf2ba22f0f5daa6d9454e24e3442e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc343e8e30e0e9785a0871196af722665d8b970e", - "reference": "cc343e8e30e0e9785a0871196af722665d8b970e", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/bbaa4927a6edf2ba22f0f5daa6d9454e24e3442e", + "reference": "bbaa4927a6edf2ba22f0f5daa6d9454e24e3442e", "shasum": "" }, "require": { @@ -6105,7 +6120,7 @@ "configuration", "options" ], - "time": "2017-01-02T20:30:24+00:00" + "time": "2017-02-21T08:33:48+00:00" }, { "name": "symfony/polyfill-apcu", @@ -6669,16 +6684,16 @@ }, { "name": "symfony/routing", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "e2d142ef10f712dfe8d983c1883270e02c783aa7" + "reference": "d145cd396f702c497cb24b21785ddac90a23fe71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/e2d142ef10f712dfe8d983c1883270e02c783aa7", - "reference": "e2d142ef10f712dfe8d983c1883270e02c783aa7", + "url": "https://api.github.com/repos/symfony/routing/zipball/d145cd396f702c497cb24b21785ddac90a23fe71", + "reference": "d145cd396f702c497cb24b21785ddac90a23fe71", "shasum": "" }, "require": { @@ -6694,7 +6709,7 @@ "symfony/config": "~2.7|~3.0.0", "symfony/expression-language": "~2.4|~3.0.0", "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/yaml": "~2.0,>=2.0.5|~3.0.0" + "symfony/yaml": "^2.0.5|~3.0.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", @@ -6740,20 +6755,20 @@ "uri", "url" ], - "time": "2017-01-27T23:54:58+00:00" + "time": "2017-03-02T15:56:34+00:00" }, { "name": "symfony/security", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/security.git", - "reference": "7d078691868d7ebd6fe268bc8fdb6ae00f8bdea2" + "reference": "f2fe48ae376237906836d98560dd90ea7e03710a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security/zipball/7d078691868d7ebd6fe268bc8fdb6ae00f8bdea2", - "reference": "7d078691868d7ebd6fe268bc8fdb6ae00f8bdea2", + "url": "https://api.github.com/repos/symfony/security/zipball/f2fe48ae376237906836d98560dd90ea7e03710a", + "reference": "f2fe48ae376237906836d98560dd90ea7e03710a", "shasum": "" }, "require": { @@ -6781,7 +6796,7 @@ "symfony/ldap": "~2.8|~3.0.0", "symfony/polyfill-intl-icu": "~1.0", "symfony/routing": "~2.2|~3.0.0", - "symfony/validator": "~2.5,>=2.5.9|~3.0.0" + "symfony/validator": "~2.7.25|^2.8.18|~3.2.5" }, "suggest": { "symfony/expression-language": "For using the expression voter", @@ -6820,7 +6835,7 @@ ], "description": "Symfony Security Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:30:51+00:00" + "time": "2017-03-04T12:20:59+00:00" }, { "name": "symfony/security-acl", @@ -6885,21 +6900,21 @@ }, { "name": "symfony/security-bundle", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "9bf6a13786bc2f551dd850f084c6bdb399f80c44" + "reference": "d072e11fad715737f0082adcb56f9adac06e31fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/9bf6a13786bc2f551dd850f084c6bdb399f80c44", - "reference": "9bf6a13786bc2f551dd850f084c6bdb399f80c44", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/d072e11fad715737f0082adcb56f9adac06e31fc", + "reference": "d072e11fad715737f0082adcb56f9adac06e31fc", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/http-kernel": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.7|~3.0.0", "symfony/polyfill-php70": "~1.0", "symfony/security": "~2.8|~3.0.0", "symfony/security-acl": "~2.7|~3.0.0" @@ -6908,17 +6923,17 @@ "doctrine/doctrine-bundle": "~1.2", "symfony/browser-kit": "~2.4|~3.0.0", "symfony/console": "~2.7|~3.0.0", - "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", - "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0", + "symfony/css-selector": "^2.0.5|~3.0.0", + "symfony/dom-crawler": "^2.0.5|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", - "symfony/form": "~2.8", - "symfony/framework-bundle": "~2.8", - "symfony/http-foundation": "~2.4|~3.0.0", - "symfony/process": "~2.0,>=2.0.5|~3.0.0", - "symfony/twig-bridge": "~2.7,>=2.7.4|~3.1.0", + "symfony/form": "^2.8.18", + "symfony/framework-bundle": "^2.8.18", + "symfony/http-foundation": "~2.7|~3.0.0", + "symfony/process": "^2.0.5|~3.0.0", + "symfony/twig-bridge": "^2.7.4|~3.1.0", "symfony/twig-bundle": "~2.7|~3.1.0", - "symfony/validator": "~2.5|~3.0.0", - "symfony/yaml": "~2.0,>=2.0.5|~3.0.0", + "symfony/validator": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "^2.0.5|~3.0.0", "twig/twig": "~1.28|~2.0" }, "type": "symfony-bundle", @@ -6951,7 +6966,7 @@ ], "description": "Symfony SecurityBundle", "homepage": "https://symfony.com", - "time": "2017-01-21T16:40:50+00:00" + "time": "2017-02-28T12:31:05+00:00" }, { "name": "symfony/stopwatch", @@ -7059,16 +7074,16 @@ }, { "name": "symfony/translation", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "c281ac2b484210bb95106bdb8ae8356e63277725" + "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/c281ac2b484210bb95106bdb8ae8356e63277725", - "reference": "c281ac2b484210bb95106bdb8ae8356e63277725", + "url": "https://api.github.com/repos/symfony/translation/zipball/b538355bc99db2ec7cc35284ec76d92ae7d1d256", + "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256", "shasum": "" }, "require": { @@ -7081,7 +7096,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.8", - "symfony/intl": "~2.4|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", "symfony/yaml": "~2.2|~3.0.0" }, "suggest": { @@ -7119,7 +7134,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-01-21T16:59:38+00:00" + "time": "2017-03-04T12:20:59+00:00" }, { "name": "symfony/twig-bridge", @@ -7204,16 +7219,16 @@ }, { "name": "symfony/validator", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "b04a58dc1f9941c3291f06a496a88393ee64fdf0" + "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/b04a58dc1f9941c3291f06a496a88393ee64fdf0", - "reference": "b04a58dc1f9941c3291f06a496a88393ee64fdf0", + "url": "https://api.github.com/repos/symfony/validator/zipball/8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", + "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", "shasum": "" }, "require": { @@ -7224,13 +7239,13 @@ "require-dev": { "doctrine/annotations": "~1.0", "doctrine/cache": "~1.0", - "egulias/email-validator": "~1.2,>=1.2.1", + "egulias/email-validator": "^1.2.1", "symfony/config": "~2.2|~3.0.0", "symfony/expression-language": "~2.4|~3.0.0", "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/intl": "~2.7.4|~2.8|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", "symfony/property-access": "~2.3|~3.0.0", - "symfony/yaml": "~2.0,>=2.0.5|~3.0.0" + "symfony/yaml": "^2.0.5|~3.0.0" }, "suggest": { "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", @@ -7273,20 +7288,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2017-01-31T21:48:58+00:00" + "time": "2017-02-28T02:24:56+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.17", + "version": "v2.8.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "322a8c2dfbca15ad6b1b27e182899f98ec0e0153" + "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/322a8c2dfbca15ad6b1b27e182899f98ec0e0153", - "reference": "322a8c2dfbca15ad6b1b27e182899f98ec0e0153", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", + "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", "shasum": "" }, "require": { @@ -7322,7 +7337,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-01-21T16:40:50+00:00" + "time": "2017-03-01T18:13:50+00:00" }, { "name": "szymach/c-pchart", @@ -8737,21 +8752,21 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.2.2", + "version": "6.2.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60" + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", "shasum": "" }, "require": { "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.3.1", + "guzzlehttp/psr7": "^1.4", "php": ">=5.5" }, "require-dev": { @@ -8795,7 +8810,7 @@ "rest", "web service" ], - "time": "2016-10-08T15:01:37+00:00" + "time": "2017-02-28T22:50:30+00:00" }, { "name": "guzzlehttp/promises", diff --git a/main/inc/lib/formvalidator/Element/DateRangePicker.php b/main/inc/lib/formvalidator/Element/DateRangePicker.php index 62a8632956..1386841379 100755 --- a/main/inc/lib/formvalidator/Element/DateRangePicker.php +++ b/main/inc/lib/formvalidator/Element/DateRangePicker.php @@ -96,8 +96,7 @@ class DateRangePicker extends HTML_QuickForm_text // timeFormat: 'hh:mm' $js .= "