]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5877 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Jun 2023 17:15:10 +0000 (19:15 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 9 Jun 2023 17:15:10 +0000 (19:15 +0200)
public/packages/daterangepicker/daterangepicker.css
public/packages/daterangepicker/daterangepicker.js
resources/views/fluidbook_stats/summary.blade.php

index a96380496ee3751027b56970d4b3398a7cd697ce..ad0a5e33816a3ff242aab326c98e94f5242698b6 100644 (file)
@@ -1,410 +1,7 @@
-.daterangepicker {
-  position: absolute;
-  color: inherit;
-  background-color: #fff;
-  border-radius: 4px;
-  border: 1px solid #ddd;
-  width: 278px;
-  max-width: none;
-  padding: 0;
-  margin-top: 7px;
-  top: 100px;
-  left: 20px;
-  z-index: 3001;
-  display: none;
-  font-family: arial;
-  font-size: 15px;
-  line-height: 1em;
-}
-
-.daterangepicker:before, .daterangepicker:after {
-  position: absolute;
-  display: inline-block;
-  border-bottom-color: rgba(0, 0, 0, 0.2);
-  content: '';
-}
-
-.daterangepicker:before {
-  top: -7px;
-  border-right: 7px solid transparent;
-  border-left: 7px solid transparent;
-  border-bottom: 7px solid #ccc;
-}
-
-.daterangepicker:after {
-  top: -6px;
-  border-right: 6px solid transparent;
-  border-bottom: 6px solid #fff;
-  border-left: 6px solid transparent;
-}
-
-.daterangepicker.opensleft:before {
-  right: 9px;
-}
-
-.daterangepicker.opensleft:after {
-  right: 10px;
-}
-
-.daterangepicker.openscenter:before {
-  left: 0;
-  right: 0;
-  width: 0;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-.daterangepicker.openscenter:after {
-  left: 0;
-  right: 0;
-  width: 0;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-.daterangepicker.opensright:before {
-  left: 9px;
-}
-
-.daterangepicker.opensright:after {
-  left: 10px;
-}
-
-.daterangepicker.drop-up {
-  margin-top: -7px;
-}
-
-.daterangepicker.drop-up:before {
-  top: initial;
-  bottom: -7px;
-  border-bottom: initial;
-  border-top: 7px solid #ccc;
-}
-
-.daterangepicker.drop-up:after {
-  top: initial;
-  bottom: -6px;
-  border-bottom: initial;
-  border-top: 6px solid #fff;
-}
-
-.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar {
-  float: none;
-}
-
-.daterangepicker.single .drp-selected {
-  display: none;
-}
-
-.daterangepicker.show-calendar .drp-calendar {
-  display: block;
-}
-
-.daterangepicker.show-calendar .drp-buttons {
-  display: block;
-}
-
-.daterangepicker.auto-apply .drp-buttons {
-  display: none;
-}
-
-.daterangepicker .drp-calendar {
-  display: none;
-  max-width: 270px;
-}
-
-.daterangepicker .drp-calendar.left {
-  padding: 8px 0 8px 8px;
-}
-
-.daterangepicker .drp-calendar.right {
-  padding: 8px;
-}
-
-.daterangepicker .drp-calendar.single .calendar-table {
-  border: none;
-}
-
-.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span {
-  color: #fff;
-  border: solid black;
-  border-width: 0 2px 2px 0;
-  border-radius: 0;
-  display: inline-block;
-  padding: 3px;
-}
-
-.daterangepicker .calendar-table .next span {
-  transform: rotate(-45deg);
-  -webkit-transform: rotate(-45deg);
-}
-
-.daterangepicker .calendar-table .prev span {
-  transform: rotate(135deg);
-  -webkit-transform: rotate(135deg);
-}
-
-.daterangepicker .calendar-table th, .daterangepicker .calendar-table td {
-  white-space: nowrap;
-  text-align: center;
-  vertical-align: middle;
-  min-width: 32px;
-  width: 32px;
-  height: 24px;
-  line-height: 24px;
-  font-size: 12px;
-  border-radius: 4px;
-  border: 1px solid transparent;
-  white-space: nowrap;
-  cursor: pointer;
-}
-
-.daterangepicker .calendar-table {
-  border: 1px solid #fff;
-  border-radius: 4px;
-  background-color: #fff;
-}
-
-.daterangepicker .calendar-table table {
-  width: 100%;
-  margin: 0;
-  border-spacing: 0;
-  border-collapse: collapse;
-}
-
-.daterangepicker td.available:hover, .daterangepicker th.available:hover {
-  background-color: #eee;
-  border-color: transparent;
-  color: inherit;
-}
-
-.daterangepicker td.week, .daterangepicker th.week {
-  font-size: 80%;
-  color: #ccc;
-}
-
-.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
-  background-color: #fff;
-  border-color: transparent;
-  color: #999;
-}
-
-.daterangepicker td.in-range {
-  background-color: #ebf4f8;
-  border-color: transparent;
-  color: #000;
-  border-radius: 0;
-}
-
-.daterangepicker td.start-date {
-  border-radius: 4px 0 0 4px;
-}
-
-.daterangepicker td.end-date {
-  border-radius: 0 4px 4px 0;
-}
-
-.daterangepicker td.start-date.end-date {
-  border-radius: 4px;
-}
-
-.daterangepicker td.active, .daterangepicker td.active:hover {
-  background-color: #357ebd;
-  border-color: transparent;
-  color: #fff;
-}
-
-.daterangepicker th.month {
-  width: auto;
-}
-
-.daterangepicker td.disabled, .daterangepicker option.disabled {
-  color: #999;
-  cursor: not-allowed;
-  text-decoration: line-through;
-}
-
-.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: 0 auto;
-  background: #eee;
-  border: 1px solid #eee;
-  padding: 2px;
-  outline: 0;
-  font-size: 12px;
-}
-
-.daterangepicker .calendar-time {
-  text-align: center;
-  margin: 4px auto 0 auto;
-  line-height: 30px;
-  position: relative;
-}
-
-.daterangepicker .calendar-time select.disabled {
-  color: #ccc;
-  cursor: not-allowed;
-}
-
-.daterangepicker .drp-buttons {
-  clear: both;
-  text-align: right;
-  padding: 8px;
-  border-top: 1px solid #ddd;
-  display: none;
-  line-height: 12px;
-  vertical-align: middle;
-}
-
-.daterangepicker .drp-selected {
-  display: inline-block;
-  font-size: 12px;
-  padding-right: 8px;
-}
-
-.daterangepicker .drp-buttons .btn {
-  margin-left: 8px;
-  font-size: 12px;
-  font-weight: bold;
-  padding: 4px 8px;
-}
-
-.daterangepicker.show-ranges.single.rtl .drp-calendar.left {
-  border-right: 1px solid #ddd;
-}
-
-.daterangepicker.show-ranges.single.ltr .drp-calendar.left {
-  border-left: 1px solid #ddd;
-}
-
-.daterangepicker.show-ranges.rtl .drp-calendar.right {
-  border-right: 1px solid #ddd;
-}
-
-.daterangepicker.show-ranges.ltr .drp-calendar.left {
-  border-left: 1px solid #ddd;
-}
-
-.daterangepicker .ranges {
-  float: none;
-  text-align: left;
-  margin: 0;
-}
-
-.daterangepicker.show-calendar .ranges {
-  margin-top: 8px;
-}
-
-.daterangepicker .ranges ul {
-  list-style: none;
-  margin: 0 auto;
-  padding: 0;
-  width: 100%;
-}
-
-.daterangepicker .ranges li {
-  font-size: 12px;
-  padding: 8px 12px;
-  cursor: pointer;
-}
-
-.daterangepicker .ranges li:hover {
-  background-color: #eee;
-}
-
-.daterangepicker .ranges li.active {
-  background-color: #08c;
-  color: #fff;
-}
-
-/*  Larger Screen Styling */
-@media (min-width: 564px) {
-  .daterangepicker {
-    width: auto;
-  }
-
-  .daterangepicker .ranges ul {
-    width: 140px;
-  }
-
-  .daterangepicker.single .ranges ul {
-    width: 100%;
-  }
-
-  .daterangepicker.single .drp-calendar.left {
-    clear: none;
-  }
-
-  .daterangepicker.single .ranges, .daterangepicker.single .drp-calendar {
-    float: left;
-  }
-
-  .daterangepicker {
-    direction: ltr;
-    text-align: left;
-  }
-
-  .daterangepicker .drp-calendar.left {
-    clear: left;
-    margin-right: 0;
-  }
-
-  .daterangepicker .drp-calendar.left .calendar-table {
-    border-right: none;
-    border-top-right-radius: 0;
-    border-bottom-right-radius: 0;
-  }
-
-  .daterangepicker .drp-calendar.right {
-    margin-left: 0;
-  }
-
-  .daterangepicker .drp-calendar.right .calendar-table {
-    border-left: none;
-    border-top-left-radius: 0;
-    border-bottom-left-radius: 0;
-  }
-
-  .daterangepicker .drp-calendar.left .calendar-table {
-    padding-right: 8px;
-  }
-
-  .daterangepicker .ranges, .daterangepicker .drp-calendar {
-    float: left;
-  }
-}
-
-@media (min-width: 730px) {
-  .daterangepicker .ranges {
-    width: auto;
-  }
-
-  .daterangepicker .ranges {
-    float: left;
-  }
-
-  .daterangepicker.rtl .ranges {
-    float: right;
-  }
-
-  .daterangepicker .drp-calendar.left {
-    clear: none !important;
-  }
-}
+/*!
+ * knockout-daterangepicker
+ * version: 0.1.0
+ * authors: Sensor Tower team
+ * license: MIT
+ * https://sensortower.github.io/daterangepicker
+ */.daterangepicker{display:none;position:absolute;background:#fff;box-shadow:0 2px 15px rgba(0,0,0,.3);-ms-flex-pack:start;justify-content:flex-start;border-radius:4px;padding:4px;font-size:13px;font-family:sans-serif;line-height:1.5em}.daterangepicker button,.daterangepicker form,.daterangepicker li,.daterangepicker ul{padding:0;margin:0;border:0;list-style:none;outline:0}.daterangepicker .controls{min-width:180px;margin:4px}.daterangepicker .periods li,.daterangepicker .ranges li{padding:4px 9px;margin:0;background:#f5f5f5;color:#08c;cursor:pointer}.daterangepicker .periods li.active,.daterangepicker .periods li:hover,.daterangepicker .ranges li.active,.daterangepicker .ranges li:hover{background:#08c;color:#fff}.daterangepicker .periods{display:-ms-inline-flexbox;display:inline-flex;margin:0 auto 8px}.daterangepicker .periods li:first-child{border-radius:4px 0 0 4px}.daterangepicker .periods li:last-child{border-radius:0 4px 4px 0}.daterangepicker .ranges{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}.daterangepicker .ranges li{border-radius:4px;margin-bottom:8px;text-align:left}.daterangepicker .custom-range-inputs{display:-ms-flexbox;display:flex;margin:-3px -3px 5px}.daterangepicker .custom-range-inputs input{min-width:50px;width:50px;-ms-flex:1;flex:1;margin:3px;border-radius:4px;border:1px solid #ccc;height:auto;padding:.5em;font-size:13px;color:#333}.daterangepicker .custom-range-buttons{display:-ms-flexbox;display:flex;margin:-3px}.daterangepicker .custom-range-buttons button{padding:4px 9px;margin:3px;border-radius:4px;background:#f5f5f5;color:#08c}.daterangepicker .custom-range-buttons button:hover{background:#dcdcdc}.daterangepicker .custom-range-buttons button.apply-btn{background:#38A551;color:#fff}.daterangepicker .custom-range-buttons button.apply-btn:hover{background:#2b7f3e}.daterangepicker .arrow-left,.daterangepicker .arrow-right{display:inline-block;position:relative;background-color:#333;width:7px;height:3px;margin-bottom:2px;vertical-align:middle}.daterangepicker .arrow-left:before,.daterangepicker .arrow-right:before{content:'';display:block;position:absolute;border:5px solid transparent}.daterangepicker .arrow-left{margin-left:5px}.daterangepicker .arrow-left:before{border-right-width:6px;border-right-color:#333;transform:translate(-10px,-3.5px)}.daterangepicker .arrow-right{margin-right:5px}.daterangepicker .arrow-right:before{border-left-width:6px;border-left-color:#333;transform:translate(6px,-3.5px)}.daterangepicker.orientation-left:not(.standalone):before,.daterangepicker.orientation-right:not(.standalone):before{position:absolute;top:-7px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.2);border-left:7px solid transparent}.daterangepicker.orientation-right:not(.standalone):before{left:9px;content:''}.daterangepicker.orientation-left:not(.standalone):before{right:9px;content:''}.daterangepicker.orientation-left:not(.standalone):after,.daterangepicker.orientation-right:not(.standalone):after{position:absolute;top:-6px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.daterangepicker.orientation-right:not(.standalone):after{left:10px}.daterangepicker.orientation-left:not(.standalone):after{right:10px}.calendar,.daterangepicker select.hidden{display:none}.daterangepicker select{width:100%;box-sizing:border-box;padding:2px 7px;height:auto;font-size:13px;line-height:1.5em;text-align:center;margin:0 2px}.daterangepicker select.month-select{-ms-flex:10;flex:10;max-width:75%}.daterangepicker select.decade-select,.daterangepicker select.year-select{-ms-flex:11;flex:11;max-width:75%}.calendar{margin:4px}.calendar .calendar-header,.calendar .calendar-table{min-width:190px;margin-left:auto;margin-right:auto}.calendar .calendar-title{padding:4px 9px;margin:0 auto 8px;text-align:center;display:block}.calendar .calendar-header button{margin:0;padding:4px 0;width:100%;border-radius:4px;background:0 0}.calendar .calendar-header button:hover{background:#f5f5f5}.calendar .calendar-header{display:-ms-flexbox;display:flex;margin:0 6px 4px}.calendar .calendar-header .calendar-selects{-ms-flex:5;flex:5;text-align:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:2px}.calendar .calendar-header .arrow{-ms-flex:1;flex:1;text-align:center}.calendar .calendar-header .arrow.arrow-hidden{visibility:hidden}.calendar .calendar-table{height:180px;border:1px solid #f5f5f5;border-radius:4px;overflow:hidden;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex-direction:column;flex-direction:column}.calendar .calendar-table .table-row{display:-ms-flexbox;display:flex;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex:1;flex:1}.calendar .calendar-table .table-row .table-col{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;text-align:center;line-height:1;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.calendar .calendar-table .table-row .table-col .table-value-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center}.calendar .calendar-table .table-row .table-col .table-value-wrapper .table-value{-ms-flex:1;flex:1}.calendar .calendar-table .table-row .table-col .week-day.unavailable,.calendar .calendar-table .table-row .table-col.out-of-boundaries,.calendar .calendar-table .table-row .table-col.unavailable{color:#bbb}.calendar .calendar-table .table-row .table-col.in-range{background:rgba(0,136,204,.1)}.calendar .calendar-table .table-row .table-col.clickable{cursor:pointer}.calendar .calendar-table .table-row .table-col.clickable:hover .table-value-wrapper{background:#eee;border-radius:4px}.calendar .calendar-table .table-row .table-col.end-date .table-value-wrapper,.calendar .calendar-table .table-row .table-col.start-date .table-value-wrapper{border-radius:4px}.calendar .calendar-table .table-row .table-col.end-date .table-value-wrapper,.calendar .calendar-table .table-row .table-col.end-date .table-value-wrapper:hover,.calendar .calendar-table .table-row .table-col.start-date .table-value-wrapper,.calendar .calendar-table .table-row .table-col.start-date .table-value-wrapper:hover{background:#08c;color:#fff}.calendar .calendar-table .table-row .table-col.end-date.out-of-boundaries .table-value-wrapper,.calendar .calendar-table .table-row .table-col.end-date.out-of-boundaries .table-value-wrapper:hover,.calendar .calendar-table .table-row .table-col.start-date.out-of-boundaries .table-value-wrapper,.calendar .calendar-table .table-row .table-col.start-date.out-of-boundaries .table-value-wrapper:hover{background:#bbb}.calendar .calendar-table .table-row .table-col.start-date{border-radius:4px 0 0 4px}.calendar .calendar-table .table-row .table-col.end-date{border-radius:0 4px 4px 0}.calendar .calendar-table .table-row .table-col .week-day{-ms-flex:1;flex:1;text-align:center}.calendar .calendar-table .table-row.weekdays .table-col{font-weight:700}.daterangepicker.opened{display:-ms-inline-flexbox;display:inline-flex}.daterangepicker.expanded .calendar{display:block}.daterangepicker.hide-periods .calendar .calendar-title,.daterangepicker.hide-periods .periods,.daterangepicker.hide-weekdays .weekdays,.daterangepicker.single .calendar .calendar-title,.daterangepicker.single .custom-range-buttons,.daterangepicker.single .custom-range-inputs,.daterangepicker.single .ranges,.daterangepicker.standalone .custom-range-buttons{display:none}.daterangepicker.standalone{position:static}.daterangepicker.single{-ms-flex-direction:column;flex-direction:column}.daterangepicker.single .controls{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.daterangepicker.single .controls .periods{margin-bottom:0}.daterangepicker.single .calendar .calendar-header{margin-left:0;margin-right:0}.daterangepicker.single .calendar .calendar-table{border:none;padding:0}.daterangepicker.single.hide-periods .controls{display:none}.daterangepicker.month-period .table-col,.daterangepicker.year-period .table-col{font-size:1.25em}.daterangepicker.quarter-period .table-col{-ms-flex-direction:column;flex-direction:column;font-size:2em}.daterangepicker.quarter-period .table-col .months{font-size:.5em;opacity:.75}.daterangepicker.orientation-left:not(.single) .controls{-ms-flex-order:2;order:2}
\ No newline at end of file
index 5f7d304b55405cd1ab4bc49073240ff9d0ce8922..e97c2283890cae285953efa6502b34b8753f210e 100644 (file)
-/**
-* @version: 3.1
-* @author: Dan Grossman http://www.dangrossman.info/
-* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.
-* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
-* @website: http://www.daterangepicker.com/
-*/
-// Following 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) {
-            if (!jquery.fn) jquery.fn = {}; // webpack server rendering
-            if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default']
-            return 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 = {};
-        }
-        var moment = (typeof window != 'undefined' && typeof window.moment != 'undefined') ? window.moment : require('moment');
-        module.exports = factory(moment, jQuery);
-    } else {
-        // Browser globals
-        root.daterangepicker = factory(root.moment, root.jQuery);
-    }
-}(typeof window !== 'undefined' ? window : this, function(moment, $) {
-    var DateRangePicker = function(element, options, cb) {
-
-        //default settings for options
-        this.parentEl = 'body';
-        this.element = $(element);
-        this.startDate = moment().startOf('day');
-        this.endDate = moment().endOf('day');
-        this.minDate = false;
-        this.maxDate = false;
-        this.maxSpan = false;
-        this.autoApply = false;
-        this.singleDatePicker = false;
-        this.showDropdowns = false;
-        this.minYear = moment().subtract(100, 'year').format('YYYY');
-        this.maxYear = moment().add(100, 'year').format('YYYY');
-        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.applyButtonClasses = 'btn-primary';
-        this.cancelButtonClasses = '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 = {};
-
-        //custom options from user
-        if (typeof options !== 'object' || options === null)
-            options = {};
-
-        //allow setting options with data attributes
-        //data-api options will be overwritten with custom javascript options
-        options = $.extend(this.element.data(), options);
-
-        //html template for the picker UI
-        if (typeof options.template !== 'string' && !(options.template instanceof $))
-            options.template =
-            '<div class="daterangepicker">' +
-                '<div class="ranges"></div>' +
-                '<div class="drp-calendar left">' +
-                    '<div class="calendar-table"></div>' +
-                    '<div class="calendar-time"></div>' +
-                '</div>' +
-                '<div class="drp-calendar right">' +
-                    '<div class="calendar-table"></div>' +
-                    '<div class="calendar-time"></div>' +
-                '</div>' +
-                '<div class="drp-buttons">' +
-                    '<span class="drp-selected"></span>' +
-                    '<button class="cancelBtn" type="button"></button>' +
-                    '<button class="applyBtn" disabled="disabled" type="button"></button> ' +
-                '</div>' +
-            '</div>';
-
-        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.applyButtonClasses === 'string')
-            this.applyButtonClasses = options.applyButtonClasses;
-
-        if (typeof options.applyClass === 'string') //backwards compat
-            this.applyButtonClasses = options.applyClass;
-
-        if (typeof options.cancelButtonClasses === 'string')
-            this.cancelButtonClasses = options.cancelButtonClasses;
-
-        if (typeof options.cancelClass === 'string') //backwards compat
-            this.cancelButtonClasses = options.cancelClass;
-
-        if (typeof options.maxSpan === 'object')
-            this.maxSpan = options.maxSpan;
-
-        if (typeof options.dateLimit === 'object') //backwards compat
-            this.maxSpan = 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.minYear === 'number')
-            this.minYear = options.minYear;
-
-        if (typeof options.maxYear === 'number')
-            this.maxYear = options.maxYear;
-
-        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(':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 maxSpan
-                // 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.maxSpan && maxDate && start.clone().add(this.maxSpan).isAfter(maxDate))
-                    maxDate = start.clone().add(this.maxSpan);
-                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 = '<ul>';
-            for (range in this.ranges) {
-                list += '<li data-range-key="' + range + '">' + range + '</li>';
-            }
-            if (this.showCustomRangeLabel) {
-                list += '<li data-range-key="' + this.locale.customRangeLabel + '">' + this.locale.customRangeLabel + '</li>';
-            }
-            list += '</ul>';
-            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) {
-            this.container.addClass('auto-apply');
-        }
-
-        if (typeof options.ranges === 'object')
-            this.container.addClass('show-ranges');
-
-        if (this.singleDatePicker) {
-            this.container.addClass('single');
-            this.container.find('.drp-calendar.left').addClass('single');
-            this.container.find('.drp-calendar.left').show();
-            this.container.find('.drp-calendar.right').hide();
-            if (!this.timePicker && this.autoApply) {
-                this.container.addClass('auto-apply');
-            }
-        }
-
-        if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) {
-            this.container.addClass('show-calendar');
-        }
-
-        this.container.addClass('opens' + this.opens);
-
-        //apply CSS classes and labels to buttons
-        this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);
-        if (this.applyButtonClasses.length)
-            this.container.find('.applyBtn').addClass(this.applyButtonClasses);
-        if (this.cancelButtonClasses.length)
-            this.container.find('.cancelBtn').addClass(this.cancelButtonClasses);
-        this.container.find('.applyBtn').html(this.locale.applyLabel);
-        this.container.find('.cancelBtn').html(this.locale.cancelLabel);
-
-        //
-        // event listeners
-        //
-
-        this.container.find('.drp-calendar')
-            .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
-            .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
-            .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
-            .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, 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));
-
-        this.container.find('.ranges')
-            .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this));
-
-        this.container.find('.drp-buttons')
-            .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
-            .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this));
-
-        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.elementChanged, this),
-                'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility
-            });
-        } else {
-            this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
-            this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this));
-        }
-
-        //
-        // if attached to a text input, set the initial value
-        //
-
-        this.updateElement();
-
-    };
-
-    DateRangePicker.prototype = {
-
-        constructor: DateRangePicker,
-
-        setStartDate: function(startDate) {
-            if (typeof startDate === 'string')
-                this.startDate = moment(startDate, this.locale.format);
-
-            if (typeof startDate === 'object')
-                this.startDate = moment(startDate);
-
-            if (!this.timePicker)
-                this.startDate = this.startDate.startOf('day');
-
-            if (this.timePicker && this.timePickerIncrement)
-                this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-
-            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);
-            }
-
-            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 (!this.isShowing)
-                this.updateElement();
-
-            this.updateMonthsInView();
-        },
-
-        setEndDate: function(endDate) {
-            if (typeof endDate === 'string')
-                this.endDate = moment(endDate, this.locale.format);
-
-            if (typeof endDate === 'object')
-                this.endDate = moment(endDate);
-
-            if (!this.timePicker)
-                this.endDate = this.endDate.endOf('day');
-
-            if (this.timePicker && this.timePickerIncrement)
-                this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-
-            if (this.endDate.isBefore(this.startDate))
-                this.endDate = this.startDate.clone();
-
-            if (this.maxDate && this.endDate.isAfter(this.maxDate))
-                this.endDate = this.maxDate.clone();
-
-            if (this.maxSpan && this.startDate.clone().add(this.maxSpan).isBefore(this.endDate))
-                this.endDate = this.startDate.clone().add(this.maxSpan);
-
-            this.previousRightTime = this.endDate.clone();
-
-            this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
-
-            if (!this.isShowing)
-                this.updateElement();
-
-            this.updateMonthsInView();
-        },
-
-        isInvalidDate: function() {
-            return false;
-        },
-
-        isCustomDate: function() {
-            return false;
-        },
-
-        updateView: function() {
-            if (this.timePicker) {
-                this.renderTimePicker('left');
-                this.renderTimePicker('right');
-                if (!this.endDate) {
-                    this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled');
-                } else {
-                    this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled');
-                }
-            }
-            if (this.endDate)
-                this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
-            this.updateMonthsInView();
-            this.updateCalendars();
-            this.updateFormInputs();
-        },
-
-        updateMonthsInView: function() {
-            if (this.endDate) {
-
-                //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;
-                }
-
-                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');
-                }
-
-            } 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 (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);
-                    if (isNaN(minute)) {
-                        minute = parseInt(this.container.find('.left .minuteselect option:last').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);
-                    if (isNaN(minute)) {
-                        minute = parseInt(this.container.find('.right .minuteselect option:last').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 (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 (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 (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();
-                }
-
-            }
-
-            //make the calendar object available to hoverDate/clickDate
-            if (side == 'left') {
-                this.leftCalendar.calendar = calendar;
-            } else {
-                this.rightCalendar.calendar = calendar;
-            }
-
-            //
-            // Display the calendar
-            //
-
-            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'};
-
-            var html = '<table class="table-condensed">';
-            html += '<thead>';
-            html += '<tr>';
-
-            // add empty cell for week number
-            if (this.showWeekNumbers || this.showISOWeekNumbers)
-                html += '<th></th>';
-
-            if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) {
-                html += '<th class="prev available"><span></span></th>';
-            } else {
-                html += '<th></th>';
-            }
-
-            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()) || (this.maxYear);
-                var minYear = (minDate && minDate.year()) || (this.minYear);
-                var inMinYear = currentYear == minYear;
-                var inMaxYear = currentYear == maxYear;
-
-                var monthHtml = '<select class="monthselect">';
-                for (var m = 0; m < 12; m++) {
-                    if ((!inMinYear || (minDate && m >= minDate.month())) && (!inMaxYear || (maxDate && m <= maxDate.month()))) {
-                        monthHtml += "<option value='" + m + "'" +
-                            (m === currentMonth ? " selected='selected'" : "") +
-                            ">" + this.locale.monthNames[m] + "</option>";
-                    } else {
-                        monthHtml += "<option value='" + m + "'" +
-                            (m === currentMonth ? " selected='selected'" : "") +
-                            " disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
-                    }
-                }
-                monthHtml += "</select>";
-
-                var yearHtml = '<select class="yearselect">';
-                for (var y = minYear; y <= maxYear; y++) {
-                    yearHtml += '<option value="' + y + '"' +
-                        (y === currentYear ? ' selected="selected"' : '') +
-                        '>' + y + '</option>';
-                }
-                yearHtml += '</select>';
-
-                dateHtml = monthHtml + yearHtml;
-            }
-
-            html += '<th colspan="5" class="month">' + dateHtml + '</th>';
-            if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) {
-                html += '<th class="next available"><span></span></th>';
-            } else {
-                html += '<th></th>';
-            }
-
-            html += '</tr>';
-            html += '<tr>';
-
-            // add week number label
-            if (this.showWeekNumbers || this.showISOWeekNumbers)
-                html += '<th class="week">' + this.locale.weekLabel + '</th>';
-
-            $.each(this.locale.daysOfWeek, function(index, dayOfWeek) {
-                html += '<th>' + dayOfWeek + '</th>';
-            });
-
-            html += '</tr>';
-            html += '</thead>';
-            html += '<tbody>';
-
-            //adjust maxDate to reflect the maxSpan setting in order to
-            //grey out end dates beyond the maxSpan
-            if (this.endDate == null && this.maxSpan) {
-                var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day');
-                if (!maxDate || maxLimit.isBefore(maxDate)) {
-                    maxDate = maxLimit;
-                }
-            }
-
-            for (var row = 0; row < 6; row++) {
-                html += '<tr>';
-
-                // add week number
-                if (this.showWeekNumbers)
-                    html += '<td class="week">' + calendar[row][0].week() + '</td>';
-                else if (this.showISOWeekNumbers)
-                    html += '<td class="week">' + calendar[row][0].isoWeek() + '</td>';
-
-                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', 'ends');
-
-                    //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');
-
-                    //don't allow selection of date if a custom function decides it's invalid
-                    if (this.isInvalidDate(calendar[row][col]))
-                        classes.push('off', 'disabled');
-
-                    //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');
-
-                    //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);
-                    }
-
-                    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 += '<td class="' + cname.replace(/^\s+|\s+$/g, '') + '" data-title="' + 'r' + row + 'c' + col + '">' + calendar[row][col].date() + '</td>';
-
-                }
-                html += '</tr>';
-            }
-
-            html += '</tbody>';
-            html += '</table>';
-
-            this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html);
-
-        },
-
-        renderTimePicker: function(side) {
-
-            // 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;
-
-            var html, selected, minDate, maxDate = this.maxDate;
-
-            if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)))
-                maxDate = this.startDate.clone().add(this.maxSpan);
-
-            if (side == 'left') {
-                selected = this.startDate.clone();
-                minDate = this.minDate;
-            } else if (side == 'right') {
-                selected = this.endDate.clone();
-                minDate = this.startDate;
-
-                //Preserve the time already selected
-                var timeSelector = this.container.find('.drp-calendar.right .calendar-time');
-                if (timeSelector.html() != '') {
-
-                    selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val());
-                    selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val());
-                    selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val());
-
-                    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 (selected.isBefore(this.startDate))
-                    selected = this.startDate.clone();
-
-                if (maxDate && selected.isAfter(maxDate))
-                    selected = maxDate.clone();
-
-            }
-
-            //
-            // hours
-            //
-
-            html = '<select class="hourselect">';
-
-            var start = this.timePicker24Hour ? 0 : 1;
-            var end = this.timePicker24Hour ? 23 : 12;
-
-            for (var i = start; i <= end; i++) {
-                var i_in_24 = i;
-                if (!this.timePicker24Hour)
-                    i_in_24 = selected.hour() >= 12 ? (i == 12 ? 12 : i + 12) : (i == 12 ? 0 : i);
-
-                var time = selected.clone().hour(i_in_24);
-                var disabled = false;
-                if (minDate && time.minute(59).isBefore(minDate))
-                    disabled = true;
-                if (maxDate && time.minute(0).isAfter(maxDate))
-                    disabled = true;
-
-                if (i_in_24 == selected.hour() && !disabled) {
-                    html += '<option value="' + i + '" selected="selected">' + i + '</option>';
-                } else if (disabled) {
-                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>';
-                } else {
-                    html += '<option value="' + i + '">' + i + '</option>';
-                }
-            }
-
-            html += '</select> ';
-
-            //
-            // minutes
-            //
-
-            html += ': <select class="minuteselect">';
-
-            for (var i = 0; i < 60; i += this.timePickerIncrement) {
-                var padded = i < 10 ? '0' + i : i;
-                var time = selected.clone().minute(i);
-
-                var disabled = false;
-                if (minDate && time.second(59).isBefore(minDate))
-                    disabled = true;
-                if (maxDate && time.second(0).isAfter(maxDate))
-                    disabled = true;
-
-                if (selected.minute() == i && !disabled) {
-                    html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
-                } else if (disabled) {
-                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
-                } else {
-                    html += '<option value="' + i + '">' + padded + '</option>';
-                }
-            }
-
-            html += '</select> ';
-
-            //
-            // seconds
-            //
-
-            if (this.timePickerSeconds) {
-                html += ': <select class="secondselect">';
-
-                for (var i = 0; i < 60; i++) {
-                    var padded = i < 10 ? '0' + i : i;
-                    var time = selected.clone().second(i);
-
-                    var disabled = false;
-                    if (minDate && time.isBefore(minDate))
-                        disabled = true;
-                    if (maxDate && time.isAfter(maxDate))
-                        disabled = true;
-
-                    if (selected.second() == i && !disabled) {
-                        html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
-                    } else if (disabled) {
-                        html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
-                    } else {
-                        html += '<option value="' + i + '">' + padded + '</option>';
-                    }
-                }
-
-                html += '</select> ';
-            }
-
-            //
-            // AM/PM
-            //
-
-            if (!this.timePicker24Hour) {
-                html += '<select class="ampmselect">';
-
-                var am_html = '';
-                var pm_html = '';
-
-                if (minDate && selected.clone().hour(12).minute(0).second(0).isBefore(minDate))
-                    am_html = ' disabled="disabled" class="disabled"';
-
-                if (maxDate && selected.clone().hour(0).minute(0).second(0).isAfter(maxDate))
-                    pm_html = ' disabled="disabled" class="disabled"';
-
-                if (selected.hour() >= 12) {
-                    html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>';
-                } else {
-                    html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>';
-                }
-
-                html += '</select>';
-            }
-
-            this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html);
-
-        },
-
-        updateFormInputs: function() {
-
-            if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
-                this.container.find('button.applyBtn').prop('disabled', false);
-            } else {
-                this.container.find('button.applyBtn').prop('disabled', true);
-            }
-
-        },
-
-        move: function() {
-            var parentOffset = { top: 0, left: 0 },
-                containerTop,
-                drops = this.drops;
-
-            var parentRightEdge = $(window).width();
-            if (!this.parentEl.is('body')) {
-                parentOffset = {
-                    top: this.parentEl.offset().top - this.parentEl.scrollTop(),
-                    left: this.parentEl.offset().left - this.parentEl.scrollLeft()
-                };
-                parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
-            }
-
-            switch (drops) {
-            case 'auto':
-                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
-                if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) {
-                    containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
-                    drops = 'up';
-                }
-                break;
-            case 'up':
-                containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
-                break;
-            default:
-                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
-                break;
-            }
-
-            // Force the container to it's actual width
-            this.container.css({
-              top: 0,
-              left: 0,
-              right: 'auto'
-            });
-            var containerWidth = this.container.outerWidth();
-
-            this.container.toggleClass('drop-up', drops == 'up');
-
-            if (this.opens == 'left') {
-                var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth();
-                if (containerWidth + containerRight > $(window).width()) {
-                    this.container.css({
-                        top: containerTop,
-                        right: 'auto',
-                        left: 9
-                    });
-                } else {
-                    this.container.css({
-                        top: containerTop,
-                        right: containerRight,
-                        left: 'auto'
-                    });
-                }
-            } else if (this.opens == 'center') {
-                var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
-                                        - containerWidth / 2;
-                if (containerLeft < 0) {
-                    this.container.css({
-                        top: containerTop,
-                        right: 'auto',
-                        left: 9
-                    });
-                } else if (containerLeft + containerWidth > $(window).width()) {
-                    this.container.css({
-                        top: containerTop,
-                        left: 'auto',
-                        right: 0
-                    });
-                } else {
-                    this.container.css({
-                        top: containerTop,
-                        left: containerLeft,
-                        right: 'auto'
-                    });
-                }
-            } else {
-                var containerLeft = this.element.offset().left - parentOffset.left;
-                if (containerLeft + containerWidth > $(window).width()) {
-                    this.container.css({
-                        top: containerTop,
-                        left: 'auto',
-                        right: 0
-                    });
-                } else {
-                    this.container.css({
-                        top: containerTop,
-                        left: containerLeft,
-                        right: 'auto'
-                    });
-                }
-            }
-        },
-
-        show: function(e) {
-            if (this.isShowing) return;
-
-            // Create a click proxy that is private to this instance of datepicker, for unbinding
-            this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
-
-            // Bind global datepicker mousedown for hiding and
-            $(document)
-              .on('mousedown.daterangepicker', this._outsideClickProxy)
-              // also support mobile devices
-              .on('touchend.daterangepicker', this._outsideClickProxy)
-              // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
-              .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
-              // and also close when focus changes to outside the picker (eg. tabbing between controls)
-              .on('focusin.daterangepicker', this._outsideClickProxy);
-
-            // Reposition the picker if the window is resized while it's open
-            $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
-
-            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) {
-            if (!this.isShowing) return;
-
-            //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.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel);
-
-            //if picker is attached to a text input, update it
-            this.updateElement();
-
-            $(document).off('.daterangepicker');
-            $(window).off('.daterangepicker');
-            this.container.hide();
-            this.element.trigger('hide.daterangepicker', this);
-            this.isShowing = false;
-        },
-
-        toggle: function(e) {
-            if (this.isShowing) {
-                this.hide();
-            } else {
-                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();
-            this.element.trigger('showCalendar.daterangepicker', this);
-        },
-
-        hideCalendars: function() {
-            this.container.removeClass('show-calendar');
-            this.element.trigger('hideCalendar.daterangepicker', this);
-        },
-
-        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];
-
-                if (!this.timePicker) {
-                    this.startDate.startOf('day');
-                    this.endDate.endOf('day');
-                }
-
-                if (!this.alwaysShowCalendars)
-                    this.hideCalendars();
-                this.clickApply();
-            }
-        },
-
-        clickPrev: function(e) {
-            var cal = $(e.target).parents('.drp-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) {
-            var cal = $(e.target).parents('.drp-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) {
-
-            //ignore dates that can't be selected
-            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('.drp-calendar');
-            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
-            //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('.drp-calendar tbody td').each(function(index, el) {
-
-                    //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('.drp-calendar');
-                    var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
-
-                    if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
-                        $(el).addClass('in-range');
-                    } else {
-                        $(el).removeClass('in-range');
-                    }
-
-                });
-            }
-
-        },
-
-        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('.drp-calendar');
-            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);
-                    if (isNaN(minute)) {
-                        minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);
-                    }
-                    var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
-                    date = date.clone().hour(hour).minute(minute).second(second);
-                }
-                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);
-                    if (isNaN(minute)) {
-                        minute = parseInt(this.container.find('.right .minuteselect option:last').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) {
-                this.setEndDate(this.startDate);
-                if (!this.timePicker && this.autoApply)
-                    this.clickApply();
-            }
-
-            this.updateView();
-
-            //This is to cancel the blur event handler if the mouse was in one of the inputs
-            e.stopPropagation();
-
-        },
-
-        calculateChosenLabel: function () {
-            var customRange = true;
-            var i = 0;
-            for (var range in this.ranges) {
-              if (this.timePicker) {
-                    var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
-                    //ignore times when comparing dates if time picker seconds is not enabled
-                    if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
-                        customRange = false;
-                        this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
-                        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').attr('data-range-key');
-                        break;
-                    }
-                }
-                i++;
-            }
-            if (customRange) {
-                if (this.showCustomRangeLabel) {
-                    this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key');
-                } else {
-                    this.chosenLabel = null;
-                }
-                this.showCalendars();
-            }
-        },
-
-        clickApply: function(e) {
-            this.hide();
-            this.element.trigger('apply.daterangepicker', this);
-        },
-
-        clickCancel: function(e) {
-            this.startDate = this.oldStartDate;
-            this.endDate = this.oldEndDate;
-            this.hide();
-            this.element.trigger('cancel.daterangepicker', this);
-        },
-
-        monthOrYearChanged: function(e) {
-            var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'),
-                leftOrRight = isLeft ? 'left' : 'right',
-                cal = this.container.find('.drp-calendar.'+leftOrRight);
-
-            // Month must be Number for new moment versions
-            var month = parseInt(cal.find('.monthselect').val(), 10);
-            var year = cal.find('.yearselect').val();
-
-            if (!isLeft) {
-                if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
-                    month = this.startDate.month();
-                    year = this.startDate.year();
-                }
-            }
-
-            if (this.minDate) {
-                if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
-                    month = this.minDate.month();
-                    year = this.minDate.year();
-                }
-            }
-
-            if (this.maxDate) {
-                if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
-                    month = this.maxDate.month();
-                    year = this.maxDate.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();
-        },
-
-        timeChanged: function(e) {
-
-            var cal = $(e.target).closest('.drp-calendar'),
-                isLeft = cal.hasClass('left');
-
-            var hour = parseInt(cal.find('.hourselect').val(), 10);
-            var minute = parseInt(cal.find('.minuteselect').val(), 10);
-            if (isNaN(minute)) {
-                minute = parseInt(cal.find('.minuteselect option:last').val(), 10);
-            }
-            var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
-
-            if (!this.timePicker24Hour) {
-                var ampm = cal.find('.ampmselect').val();
-                if (ampm === 'PM' && hour < 12)
-                    hour += 12;
-                if (ampm === 'AM' && hour === 12)
-                    hour = 0;
-            }
-
-            if (isLeft) {
-                var start = this.startDate.clone();
-                start.hour(hour);
-                start.minute(minute);
-                start.second(second);
-                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.setEndDate(end);
-            }
-
-            //update the calendars so all clickable dates reflect the new time component
-            this.updateCalendars();
-
-            //update the form inputs above the calendars with the new time
-            this.updateFormInputs();
-
-            //re-render the time pickers because changing one selection can affect what's enabled in another
-            this.renderTimePicker('left');
-            this.renderTimePicker('right');
-
-        },
-
-        elementChanged: function() {
-            if (!this.element.is('input')) return;
-            if (!this.element.val().length) return;
-
-            var dateString = this.element.val().split(this.locale.separator),
-                start = null,
-                end = null;
-
-            if (dateString.length === 2) {
-                start = moment(dateString[0], this.locale.format);
-                end = moment(dateString[1], this.locale.format);
-            }
-
-            if (this.singleDatePicker || start === null || end === null) {
-                start = moment(this.element.val(), this.locale.format);
-                end = start;
-            }
-
-            if (!start.isValid() || !end.isValid()) return;
-
-            this.setStartDate(start);
-            this.setEndDate(end);
-            this.updateView();
-        },
-
-        keydown: function(e) {
-            //hide on tab or enter
-            if ((e.keyCode === 9) || (e.keyCode === 13)) {
-                this.hide();
-            }
-
-            //hide on esc and prevent propagation
-            if (e.keyCode === 27) {
-                e.preventDefault();
-                e.stopPropagation();
-
-                this.hide();
-            }
-        },
-
-        updateElement: function() {
-            if (this.element.is('input') && this.autoUpdateInput) {
-                var newValue = this.startDate.format(this.locale.format);
-                if (!this.singleDatePicker) {
-                    newValue += this.locale.separator + this.endDate.format(this.locale.format);
-                }
-                if (newValue !== this.element.val()) {
-                    this.element.val(newValue).trigger('change');
-                }
-            }
-        },
-
-        remove: function() {
-            this.container.remove();
-            this.element.off('.daterangepicker');
-            this.element.removeData();
-        }
-
-    };
-
-    $.fn.daterangepicker = function(options, callback) {
-        var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options);
-        this.each(function() {
-            var el = $(this);
-            if (el.data('daterangepicker'))
-                el.data('daterangepicker').remove();
-            el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback));
-        });
-        return this;
-    };
-
-    return DateRangePicker;
-
-}));
+/*!
+ * knockout-daterangepicker
+ * version: 0.1.0
+ * authors: Sensor Tower team
+ * license: MIT
+ * https://sensortower.github.io/daterangepicker
+ */
+(function(){var t,e,n,a,r,i,o,s,c,u,d,l=function(t,e){function n(){this.constructor=t}for(var a in e)h.call(e,a)&&(t[a]=e[a]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},h={}.hasOwnProperty,p=function(t,e){return function(){return t.apply(e,arguments)}};u=function(){function t(){}return t.patchCurrentLocale=function(t){return moment.locale(moment.locale(),t)},t.setFirstDayOfTheWeek=function(t){var e;if(t=(t%7+7)%7,moment.localeData().firstDayOfWeek()!==t)return e=t-moment.localeData().firstDayOfWeek(),this.patchCurrentLocale({week:{dow:t,doy:moment.localeData().firstDayOfYear()}})},t.tz=function(t){var e,n;return e=Array.prototype.slice.call(arguments,0,-1),n=arguments[arguments.length-1],moment.tz?moment.tz.apply(null,e.concat([n])):n&&"utc"===n.toLowerCase()?moment.utc.apply(null,e):moment.apply(null,e)},t}(),c=function(){function t(t,e){this.date=t.clone(),this.period=e}return t.array=function(t,e,n){var a,r,i,o,s;for(r=new this(t,n),s=[],a=i=0,o=e-1;0<=o?i<=o:i>=o;a=0<=o?++i:--i)s.push(r.next());return s},t.prototype.next=function(){var t;return t=this.date,this.date=t.clone().add(1,this.period),t.clone()},t}(),e=function(){function t(){}return t.rotateArray=function(t,e){return e%=t.length,t.slice(e).concat(t.slice(0,e))},t.uniqArray=function(t){var e,n,a,r;for(r=[],n=0,a=t.length;n<a;n++)e=t[n],r.indexOf(e)===-1&&r.push(e);return r},t}(),$.fn.daterangepicker=function(t,e){return null==t&&(t={}),this.each(function(){var n;if(n=$(this),!n.data("daterangepicker"))return t.anchorElement=n,e&&(t.callback=e),t.callback=$.proxy(t.callback,this),n.data("daterangepicker",new s(t))}),this},ko.bindingHandlers.stopBinding={init:function(){return{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.stopBinding=!0,ko.bindingHandlers.daterangepicker=function(){return $.extend(this,{_optionsKey:"daterangepickerOptions",_formatKey:"daterangepickerFormat",init:function(t,e,n){var a,r;return a=e(),r=ko.unwrap(n.get(this._optionsKey))||{},$(t).daterangepicker(r,function(t,e,n){return a([t,e])})},update:function(t,e,n){var a,r,i,o,s,c,u;return a=$(t),s=e()(),c=s[0],i=s[1],r=ko.unwrap(n.get(this._formatKey))||"MMM D, YYYY",u=moment(c).format(r),o=moment(i).format(r),ko.ignoreDependencies(function(){var t;return a.data("daterangepicker").standalone()||(t=a.data("daterangepicker").single()?u:u+" – "+o,a.val(t).text(t)),a.data("daterangepicker").startDate(c),a.data("daterangepicker").endDate(i)})}})}(),o=function(){function t(t,e,n){this.title=t,this.startDate=e,this.endDate=n}return t}(),t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e}(o),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return l(e,t),e}(o),d=function(){function t(){}return t.allPeriods=["day","week","month","quarter","year"],t.scale=function(t){return"day"===t||"week"===t?"month":"year"},t.showWeekDayNames=function(t){return"day"===t||"week"===t},t.nextPageArguments=function(t){var e,n;return e="year"===t?9:1,n=this.scale(t),[e,n]},t.format=function(t){switch(t){case"day":case"week":return"D";case"month":return"MMM";case"quarter":return"\\QQ";case"year":return"YYYY"}},t.title=function(t){switch(t){case"day":return"Day";case"week":return"Week";case"month":return"Month";case"quarter":return"Quarter";case"year":return"Year"}},t.dimentions=function(t){switch(t){case"day":return[7,6];case"week":return[1,6];case"month":return[3,4];case"quarter":return[2,2];case"year":return[3,3]}},t.methods=["scale","showWeekDayNames","nextPageArguments","format","title","dimentions"],t.extendObservable=function(e){return this.methods.forEach(function(n){return e[n]=function(){return t[n](e())}}),e},t}(),r=function(){function e(t){null==t&&(t={}),this.firstDayOfWeek=this._firstDayOfWeek(t.firstDayOfWeek),this.timeZone=this._timeZone(t.timeZone),this.periods=this._periods(t.periods),this.customPeriodRanges=this._customPeriodRanges(t.customPeriodRanges),this.period=this._period(t.period),this.single=this._single(t.single),this.opened=this._opened(t.opened),this.expanded=this._expanded(t.expanded),this.standalone=this._standalone(t.standalone),this.hideWeekdays=this._hideWeekdays(t.hideWeekdays),this.locale=this._locale(t.locale),this.orientation=this._orientation(t.orientation),this.forceUpdate=t.forceUpdate,this.minDate=this._minDate(t.minDate),this.maxDate=this._maxDate(t.maxDate),this.startDate=this._startDate(t.startDate),this.endDate=this._endDate(t.endDate),this.ranges=this._ranges(t.ranges),this.isCustomPeriodRangeActive=ko.observable(!1),this.anchorElement=this._anchorElement(t.anchorElement),this.parentElement=this._parentElement(t.parentElement),this.callback=this._callback(t.callback),this.firstDayOfWeek.subscribe(function(t){return u.setFirstDayOfTheWeek(t)}),u.setFirstDayOfTheWeek(this.firstDayOfWeek())}return e.prototype.extend=function(t){var e,n,a,r;n=this,a=[];for(e in n)r=n[e],this.hasOwnProperty(e)&&"_"!==e[0]&&a.push(t[e]=r);return a},e.prototype._firstDayOfWeek=function(t){return ko.observable(t?t:0)},e.prototype._timeZone=function(t){return ko.observable(t||"UTC")},e.prototype._periods=function(t){return ko.observableArray(t||d.allPeriods)},e.prototype._customPeriodRanges=function(t){var e,n,a;t||(t={}),e=[];for(n in t)a=t[n],e.push(this.parseRange(a,n));return e},e.prototype._period=function(t){if(t||(t=this.periods()[0]),"day"!==t&&"week"!==t&&"month"!==t&&"quarter"!==t&&"year"!==t)throw new Error("Invalid period");return d.extendObservable(ko.observable(t))},e.prototype._single=function(t){return ko.observable(t||!1)},e.prototype._opened=function(t){return ko.observable(t||!1)},e.prototype._expanded=function(t){return ko.observable(t||!1)},e.prototype._standalone=function(t){return ko.observable(t||!1)},e.prototype._hideWeekdays=function(t){return ko.observable(t||!1)},e.prototype._minDate=function(t){var e,n;return t instanceof Array&&(n=t,t=n[0],e=n[1]),t||(t=moment().subtract(30,"years")),this._dateObservable(t,e)},e.prototype._maxDate=function(t){var e,n;return t instanceof Array&&(n=t,t=n[0],e=n[1]),t||(t=moment()),this._dateObservable(t,e,this.minDate)},e.prototype._startDate=function(t){return t||(t=moment().subtract(29,"days")),this._dateObservable(t,null,this.minDate,this.maxDate)},e.prototype._endDate=function(t){return t||(t=moment()),this._dateObservable(t,null,this.startDate,this.maxDate)},e.prototype._ranges=function(e){var n,a,r;if(e||(e=this._defaultRanges()),!$.isPlainObject(e))throw new Error("Invalid ranges parameter (should be a plain object)");n=[];for(a in e)switch(r=e[a]){case"all-time":n.push(new t(a,this.minDate().clone(),this.maxDate().clone()));break;case"custom":n.push(new i(a));break;default:n.push(this.parseRange(r,a))}return n},e.prototype.parseRange=function(t,e){var n,a,r,i;if(!$.isArray(t))throw new Error("Value should be an array");if(r=t[0],n=t[1],!r)throw new Error("Missing start date");if(!n)throw new Error("Missing end date");if(a=u.tz(r,this.timeZone()),i=u.tz(n,this.timeZone()),!a.isValid())throw new Error("Invalid start date");if(!i.isValid())throw new Error("Invalid end date");return new o(e,a,i)},e.prototype._locale=function(t){return $.extend({applyButtonTitle:"Apply",cancelButtonTitle:"Cancel",inputFormat:"L",startLabel:"Start",endLabel:"End"},t||{})},e.prototype._orientation=function(t){if(t||(t="right"),"right"!==t&&"left"!==t)throw new Error("Invalid orientation");return ko.observable(t)},e.prototype._dateObservable=function(t,e,n,a){var r,i,o,s;return s=ko.observable(),r=ko.computed({read:function(){return s()},write:function(t){return function(t){var e;if(t=r.fit(t),e=s(),!e||!t.isSame(e))return s(t)}}(this)}),r.mode=e||"inclusive",o=function(t){return function(e){var a;if(n){switch(a=n(),n.mode){case"extended":a=a.clone().startOf(t.period());break;case"exclusive":a=a.clone().endOf(t.period()).add(1,"millisecond")}e=moment.max(a,e)}return e}}(this),i=function(t){return function(e){var n;if(a){switch(n=a(),a.mode){case"extended":n=n.clone().endOf(t.period());break;case"exclusive":n=n.clone().startOf(t.period()).subtract(1,"millisecond")}e=moment.min(n,e)}return e}}(this),r.fit=function(t){return function(e){return e=u.tz(e,t.timeZone()),i(o(e))}}(this),r(t),r.clone=function(t){return function(){return t._dateObservable(s(),r.mode,n,a)}}(this),r.isWithinBoundaries=function(t){return function(e){var r,i,o,s,c,d,l;return e=u.tz(e,t.timeZone()),s=n(),i=a(),r=e.isBetween(s,i,t.period()),l=e.isSame(s,t.period()),d=e.isSame(i,t.period()),c="exclusive"===n.mode,o="exclusive"===a.mode,r||!c&&l&&!(o&&d)||!o&&d&&!(c&&l)}}(this),n&&(r.minBoundary=n,n.subscribe(function(){return r(s())})),a&&(r.maxBoundary=a,a.subscribe(function(){return r(s())})),r},e.prototype._defaultRanges=function(){return{"Last 30 days":[moment().subtract(29,"days"),moment()],"Last 90 days":[moment().subtract(89,"days"),moment()],"Last Year":[moment().subtract(1,"year").add(1,"day"),moment()],"All Time":"all-time","Custom Range":"custom"}},e.prototype._anchorElement=function(t){return $(t)},e.prototype._parentElement=function(t){return $(t||(this.standalone()?this.anchorElement:"body"))},e.prototype._callback=function(t){if(t&&!$.isFunction(t))throw new Error("Invalid callback (not a function)");return t},e}(),n=function(){function t(t){this.clickNextButton=p(this.clickNextButton,this),this.clickPrevButton=p(this.clickPrevButton,this),this.currentDate=t.currentDate,this.period=t.period,this.timeZone=t.timeZone,this.firstDate=t.firstDate,this.firstYearOfDecade=t.firstYearOfDecade,this.prevDate=ko.pureComputed(function(t){return function(){var e,n,a;return a=t.period.nextPageArguments(),e=a[0],n=a[1],t.currentDate().clone().subtract(e,n)}}(this)),this.nextDate=ko.pureComputed(function(t){return function(){var e,n,a;return a=t.period.nextPageArguments(),e=a[0],n=a[1],t.currentDate().clone().add(e,n)}}(this)),this.selectedMonth=ko.computed({read:function(t){return function(){return t.currentDate().month()}}(this),write:function(t){return function(e){var n;if(n=t.currentDate().clone().month(e),!n.isSame(t.currentDate(),"month"))return t.currentDate(n)}}(this),pure:!0}),this.selectedYear=ko.computed({read:function(t){return function(){return t.currentDate().year()}}(this),write:function(t){return function(e){var n;if(n=t.currentDate().clone().year(e),!n.isSame(t.currentDate(),"year"))return t.currentDate(n)}}(this),pure:!0}),this.selectedDecade=ko.computed({read:function(t){return function(){return t.firstYearOfDecade(t.currentDate()).year()}}(this),write:function(t){return function(e){var n,a,r;if(r=(t.currentDate().year()-t.selectedDecade())%9,a=e+r,n=t.currentDate().clone().year(a),!n.isSame(t.currentDate(),"year"))return t.currentDate(n)}}(this),pure:!0})}return t.prototype.clickPrevButton=function(){return this.currentDate(this.prevDate())},t.prototype.clickNextButton=function(){return this.currentDate(this.nextDate())},t.prototype.prevArrowCss=function(){var t,e;return t=this.firstDate().clone().subtract(1,"millisecond"),"day"!==(e=this.period())&&"week"!==e||(t=t.endOf("month")),{"arrow-hidden":!this.currentDate.isWithinBoundaries(t)}},t.prototype.nextArrowCss=function(){var t,e,n,a,r;return n=this.period.dimentions(),t=n[0],r=n[1],e=this.firstDate().clone().add(t*r,this.period()),"day"!==(a=this.period())&&"week"!==a||(e=e.startOf("month")),{"arrow-hidden":!this.currentDate.isWithinBoundaries(e)}},t.prototype.monthOptions=function(){var t,e,n;return e=this.currentDate.minBoundary().isSame(this.currentDate(),"year")?this.currentDate.minBoundary().month():0,t=this.currentDate.maxBoundary().isSame(this.currentDate(),"year")?this.currentDate.maxBoundary().month():11,function(){n=[];for(var a=e;e<=t?a<=t:a>=t;e<=t?a++:a--)n.push(a);return n}.apply(this)},t.prototype.yearOptions=function(){var t,e;return function(){e=[];for(var n=t=this.currentDate.minBoundary().year(),a=this.currentDate.maxBoundary().year();t<=a?n<=a:n>=a;t<=a?n++:n--)e.push(n);return e}.apply(this)},t.prototype.decadeOptions=function(){return e.uniqArray(this.yearOptions().map(function(t){return function(e){var n;return n=u.tz([e],t.timeZone()),t.firstYearOfDecade(n).year()}}(this)))},t.prototype.monthSelectorAvailable=function(){var t;return"day"===(t=this.period())||"week"===t},t.prototype.yearSelectorAvailable=function(){return"year"!==this.period()},t.prototype.decadeSelectorAvailable=function(){return"year"===this.period()},t.prototype.monthFormatter=function(t){return moment.utc([2015,t]).format("MMM")},t.prototype.yearFormatter=function(t){return moment.utc([t]).format("YYYY")},t.prototype.decadeFormatter=function(t){var e,n,a,r;return n=d.dimentions("year"),e=n[0],a=n[1],r=t+e*a-1,t+" – "+r},t}(),a=function(){function t(t,e,a){this.cssForDate=p(this.cssForDate,this),this.eventsForDate=p(this.eventsForDate,this),this.formatDateTemplate=p(this.formatDateTemplate,this),this.tableValues=p(this.tableValues,this),this.inRange=p(this.inRange,this),this.period=t.period,this.single=t.single,this.timeZone=t.timeZone,this.locale=t.locale,this.startDate=t.startDate,this.endDate=t.endDate,this.isCustomPeriodRangeActive=t.isCustomPeriodRangeActive,this.type=a,this.label=t.locale[a+"Label"]||"",this.hoverDate=ko.observable(null),this.activeDate=e,this.currentDate=e.clone(),this.inputDate=ko.computed({read:function(t){return function(){return(t.hoverDate()||t.activeDate()).format(t.locale.inputFormat)}}(this),write:function(t){return function(e){var n;if(n=u.tz(e,t.locale.inputFormat,t.timeZone()),n.isValid())return t.activeDate(n)}}(this),pure:!0}),this.firstDate=ko.pureComputed(function(t){return function(){var e,n;switch(e=t.currentDate().clone().startOf(t.period.scale()),t.period()){case"day":case"week":n=e.clone(),e.weekday(0),(e.isAfter(n)||e.isSame(n,"day"))&&e.subtract(1,"week");break;case"year":e=t.firstYearOfDecade(e)}return e}}(this)),this.activeDate.subscribe(function(t){return function(e){return t.currentDate(e)}}(this)),this.headerView=new n(this)}return t.prototype.calendar=function(){var t,e,n,a,r,i,o,s,u,d;for(i=this.period.dimentions(),e=i[0],d=i[1],a=new c(this.firstDate(),this.period()),s=[],u=r=1,o=d;1<=o?r<=o:r>=o;u=1<=o?++r:--r)s.push(function(){var r,i,o;for(o=[],t=r=1,i=e;1<=i?r<=i:r>=i;t=1<=i?++r:--r)n=a.next(),"end"===this.type?o.push(n.endOf(this.period())):o.push(n.startOf(this.period()));return o}.call(this));return s},t.prototype.weekDayNames=function(){return e.rotateArray(moment.weekdaysMin(),moment.localeData().firstDayOfWeek())},t.prototype.inRange=function(t){return t.isAfter(this.startDate(),this.period())&&t.isBefore(this.endDate(),this.period())||t.isSame(this.startDate(),this.period())||t.isSame(this.endDate(),this.period())},t.prototype.tableValues=function(t){var e,n,a;switch(e=this.period.format(),this.period()){case"day":case"month":case"year":return[{html:t.format(e)}];case"week":return t=t.clone().startOf(this.period()),c.array(t,7,"day").map(function(t){return function(n){return{html:n.format(e),css:{"week-day":!0,unavailable:t.cssForDate(n,!0).unavailable}}}}(this));case"quarter":return a=t.format(e),t=t.clone().startOf("quarter"),n=c.array(t,3,"month").map(function(t){return t.format("MMM")}),[{html:a+"<br><span class='months'>"+n.join(", ")+"</span>"}]}},t.prototype.formatDateTemplate=function(t){return{nodes:$("<div>"+this.formatDate(t)+"</div>").children()}},t.prototype.eventsForDate=function(t){return{click:function(e){return function(){if(e.activeDate.isWithinBoundaries(t))return e.activeDate(t)}}(this),mouseenter:function(e){return function(){if(e.activeDate.isWithinBoundaries(t))return e.hoverDate(e.activeDate.fit(t))}}(this),mouseleave:function(t){return function(){return t.hoverDate(null)}}(this)}},t.prototype.cssForDate=function(t,e){var n,a,r,i,o;return i=t.isSame(this.activeDate(),this.period()),o=this.activeDate.isWithinBoundaries(t),e||(e="day"===this.period()),n=!t.isSame(this.currentDate(),"month"),a=this.inRange(t),r={"in-range":!this.single()&&(a||i)},r[this.type+"-date"]=i,r.clickable=o&&!this.isCustomPeriodRangeActive(),r["out-of-boundaries"]=!o||this.isCustomPeriodRangeActive(),r.unavailable=e&&n,r},t.prototype.firstYearOfDecade=function(t){var e,n,a,r;return e=u.tz(moment(),this.timeZone()).year(),n=e-4,a=Math.floor((t.year()-n)/9),r=n+9*a,u.tz([r],this.timeZone())},t}(),s=function(){function t(t){var e,n,i,o;null==t&&(t={}),this.outsideClick=p(this.outsideClick,this),this.setCustomPeriodRange=p(this.setCustomPeriodRange,this),this.setDateRange=p(this.setDateRange,this),new r(t).extend(this),this.startCalendar=new a(this,this.startDate,"start"),this.endCalendar=new a(this,this.endDate,"end"),this.startDateInput=this.startCalendar.inputDate,this.endDateInput=this.endCalendar.inputDate,this.dateRange=ko.observable([this.startDate(),this.endDate()]),this.startDate.subscribe(function(t){return function(e){return t.single()?(t.endDate(e.clone().endOf(t.period())),t.updateDateRange(),t.close()):(t.endDate().isSame(e)&&t.endDate(t.endDate().clone().endOf(t.period())),t.standalone()?t.updateDateRange():void 0)}}(this)),this.style=ko.observable({}),this.callback&&(this.dateRange.subscribe(function(t){return function(e){var n,a;return a=e[0],n=e[1],t.callback(a.clone(),n.clone(),t.period())}}(this)),this.forceUpdate&&(n=this.dateRange(),i=n[0],e=n[1],this.callback(i.clone(),e.clone(),this.period()))),this.anchorElement&&(o=$('<div data-bind="stopBinding: true"></div>').appendTo(this.parentElement),this.containerElement=$(this.constructor.template).appendTo(o),ko.applyBindings(this,this.containerElement.get(0)),this.anchorElement.click(function(t){return function(){return t.updatePosition(),t.toggle()}}(this)),this.standalone()||$(document).on("mousedown.daterangepicker",this.outsideClick).on("touchend.daterangepicker",this.outsideClick).on("click.daterangepicker","[data-toggle=dropdown]",this.outsideClick).on("focusin.daterangepicker",this.outsideClick)),this.opened()&&this.updatePosition()}return t.prototype.periodProxy=d,t.prototype.calendars=function(){return this.single()?[this.startCalendar]:[this.startCalendar,this.endCalendar]},t.prototype.updateDateRange=function(){return this.dateRange([this.startDate(),this.endDate()])},t.prototype.cssClasses=function(){var t,e,n,a,r;for(n={single:this.single(),opened:this.standalone()||this.opened(),expanded:this.standalone()||this.single()||this.expanded(),standalone:this.standalone(),"hide-weekdays":this.hideWeekdays(),"hide-periods":this.periods().length+this.customPeriodRanges.length===1,"orientation-left":"left"===this.orientation(),"orientation-right":"right"===this.orientation()},r=d.allPeriods,t=0,e=r.length;t<e;t++)a=r[t],n[a+"-period"]=a===this.period();return n},t.prototype.isActivePeriod=function(t){return this.period()===t},t.prototype.isActiveDateRange=function(t){var e,n,a,r;if(t.constructor===i){for(r=this.ranges,n=0,a=r.length;n<a;n++)if(e=r[n],e.constructor!==i&&this.isActiveDateRange(e))return!1;return!0}return this.startDate().isSame(t.startDate,"day")&&this.endDate().isSame(t.endDate,"day")},t.prototype.isActiveCustomPeriodRange=function(t){return this.isActiveDateRange(t)&&this.isCustomPeriodRangeActive()},t.prototype.inputFocus=function(){return this.expanded(!0)},t.prototype.setPeriod=function(t){return this.isCustomPeriodRangeActive(!1),this.period(t),this.expanded(!0)},t.prototype.setDateRange=function(t){return t.constructor===i?this.expanded(!0):(this.expanded(!1),this.close(),this.period("day"),this.startDate(t.startDate),this.endDate(t.endDate),this.updateDateRange())},t.prototype.setCustomPeriodRange=function(t){return this.isCustomPeriodRangeActive(!0),this.setDateRange(t)},t.prototype.applyChanges=function(){return this.close(),this.updateDateRange()},t.prototype.cancelChanges=function(){return this.close()},t.prototype.open=function(){return this.opened(!0)},t.prototype.close=function(){if(!this.standalone())return this.opened(!1)},t.prototype.toggle=function(){return this.opened()?this.close():this.open()},t.prototype.updatePosition=function(){var t,e,n;if(!this.standalone()){switch(t={top:0,left:0},e=$(window).width(),this.parentElement.is("body")||(t={top:this.parentElement.offset().top-this.parentElement.scrollTop(),left:this.parentElement.offset().left-this.parentElement.scrollLeft()},e=this.parentElement.get(0).clientWidth+this.parentElement.offset().left),n={top:this.anchorElement.offset().top+this.anchorElement.outerHeight()-t.top+"px",left:"auto",right:"auto"},this.orientation()){case"left":this.containerElement.offset().left<0?n.left="9px":n.right=e-this.anchorElement.offset().left-this.anchorElement.outerWidth()+"px";break;default:this.containerElement.offset().left+this.containerElement.outerWidth()>$(window).width()?n.right="0":n.left=this.anchorElement.offset().left-t.left+"px"}return this.style(n)}},t.prototype.outsideClick=function(t){var e;if(e=$(t.target),!("focusin"===t.type||e.closest(this.anchorElement).length||e.closest(this.containerElement).length||e.closest(".calendar").length))return this.close()},t}(),s.template='<div class="daterangepicker" data-bind="css: $data.cssClasses(), style: $data.style()"> <div class="controls"> <ul class="periods"> <!-- ko foreach: $data.periods --> <li class="period" data-bind="css: {active: $parent.isActivePeriod($data) && !$parent.isCustomPeriodRangeActive()}, text: $parent.periodProxy.title($data), click: function(){ $parent.setPeriod($data); }"></li> <!-- /ko --> <!-- ko foreach: $data.customPeriodRanges --> <li class="period" data-bind="css: {active: $parent.isActiveCustomPeriodRange($data)}, text: $data.title, click: function(){ $parent.setCustomPeriodRange($data); }"></li> <!-- /ko --> </ul> <ul class="ranges" data-bind="foreach: $data.ranges"> <li class="range" data-bind="css: {active: $parent.isActiveDateRange($data)}, text: $data.title, click: function(){ $parent.setDateRange($data); }"></li> </ul> <form data-bind="submit: $data.applyChanges"> <div class="custom-range-inputs"> <input type="text" data-bind="value: $data.startDateInput, event: {focus: $data.inputFocus}" /> <input type="text" data-bind="value: $data.endDateInput, event: {focus: $data.inputFocus}" /> </div> <div class="custom-range-buttons"> <button class="apply-btn" type="submit" data-bind="text: $data.locale.applyButtonTitle, click: $data.applyChanges"></button> <button class="cancel-btn" data-bind="text: $data.locale.cancelButtonTitle, click: $data.cancelChanges"></button> </div> </form> </div> <!-- ko foreach: $data.calendars() --> <div class="calendar"> <div class="calendar-title" data-bind="text: $data.label"></div> <div class="calendar-header" data-bind="with: $data.headerView"> <div class="arrow" data-bind="css: $data.prevArrowCss()"> <button data-bind="click: $data.clickPrevButton"><span class="arrow-left"></span></button> </div> <div class="calendar-selects"> <select class="month-select" data-bind="options: $data.monthOptions(), optionsText: $data.monthFormatter, valueAllowUnset: true, value: $data.selectedMonth, css: {hidden: !$data.monthSelectorAvailable()}"></select> <select class="year-select" data-bind="options: $data.yearOptions(), optionsText: $data.yearFormatter, valueAllowUnset: true, value: $data.selectedYear, css: {hidden: !$data.yearSelectorAvailable()}"></select> <select class="decade-select" data-bind="options: $data.decadeOptions(), optionsText: $data.decadeFormatter, valueAllowUnset: true, value: $data.selectedDecade, css: {hidden: !$data.decadeSelectorAvailable()}"></select> </div> <div class="arrow" data-bind="css: $data.nextArrowCss()"> <button data-bind="click: $data.clickNextButton"><span class="arrow-right"></span></button> </div> </div> <div class="calendar-table"> <!-- ko if: $parent.periodProxy.showWeekDayNames($data.period()) --> <div class="table-row weekdays" data-bind="foreach: $data.weekDayNames()"> <div class="table-col"> <div class="table-value-wrapper"> <div class="table-value" data-bind="text: $data"></div> </div> </div> </div> <!-- /ko --> <!-- ko foreach: $data.calendar() --> <div class="table-row" data-bind="foreach: $data"> <div class="table-col" data-bind="event: $parents[1].eventsForDate($data), css: $parents[1].cssForDate($data)"> <div class="table-value-wrapper" data-bind="foreach: $parents[1].tableValues($data)"> <div class="table-value" data-bind="html: $data.html, css: $data.css"></div> </div> </div> </div> <!-- /ko --> </div> </div> <!-- /ko --> </div>',$.extend($.fn.daterangepicker,{ArrayUtils:e,MomentIterator:c,MomentUtil:u,Period:d,Config:r,DateRange:o,AllTimeDateRange:t,CustomDateRange:i,DateRangePickerView:s,CalendarView:a,CalendarHeaderView:n})}).call(this);
\ No newline at end of file
index 589ba1c89220e2f19c11ff06c4cb89e6b14284cb..5f04b6f985dbba498ac22393e83bc70af0869940 100644 (file)
 
     {{-- Date Range picker setup: https://sensortower.github.io/daterangepicker/docs --}}
     <script>
-        moment.locale('{{ $locale }}');
-        @if ($locale === 'en')
-        moment.updateLocale('{{ $locale }}', {
-            longDateFormat: {
-                // Date range picker uses the 'L' format for displaying dates
-                L: 'DD/MM/YYYY', // We don't like the default, backwards US date format
-            }
-        });
-        @endif
-
         $(function () {
+            moment.locale('{{ $locale }}');
+            @if ($locale === 'en')
+            moment.updateLocale('{{ $locale }}', {
+                longDateFormat: {
+                    // Date range picker uses the 'L' format for displaying dates
+                    L: 'DD/MM/YYYY', // We don't like the default, backwards US date format
+                }
+            });
+            @endif
+
             $('[data-daterangepicker]').daterangepicker({
                 callback: function (startDate, endDate, period) {
                     let range = startDate.format('YYYY-MM-DD') + ',' + endDate.format('YYYY-MM-DD');
-                    let segmentation = document.querySelector('.daterangepicker [name="segmentation"]')?.value || false;
+                    let segmentation = $('.daterangepicker [name="segmentation"]')?.value || false;
                     let periodOverride = segmentation ? `/${segmentation}` : '';
                     location.href = `{{ $base_URL }}/${range}${periodOverride}`;
                 },
 
             });
 
-
-            {{-- Inject the segmentation (period) dropdown into the date picker --}}
+            // Inject the segmentation (period) dropdown into the date picker
             let picker = $('.daterangepicker');
 
-            let segmentOptions = '<option value="">{{ __('Affichage').__(' : ').__('Automatique') }}</option>';
+            let segmentOptions = '<select><option value="">{{ __('Affichage').__(' : ').__('Automatique') }}</option>';
             @foreach ($period_map as $period_key => $period_title)
                 segmentOptions += '<option value="{{ $period_key }}">{{ __('Affichage').__(' : ').$period_title['periodic'] }}</option>'
             @endforeach
-
-            let segmentation = document.createElement('select');
-            segmentation.name = 'segmentation';
-            segmentation.innerHTML = segmentOptions;
-            picker.find('form').prepend(segmentation);
+                segmentOptions+='</select>';
+            picker.find('form').prepend(segmentOptions);
 
             // Add arrow between range inputs
-            let rangeInputs = $(picker).find('.custom-range-inputs');
-            let arrow = document.createElement('span');
-            arrow.className = 'arrow-right';
-            rangeInputs.insertBefore(arrow, rangeInputs.children[1]); // Insert in 2nd position
+            $(picker).find('.custom-range-inputs input:eq(0)').after('<span class="arrow-right"></span>');
 
             {{--============================================================================================================--}}