diff --git a/dist/daterangepicker.css b/dist/daterangepicker.css
index 1d248ed..4cec4a5 100644
--- a/dist/daterangepicker.css
+++ b/dist/daterangepicker.css
@@ -1,6 +1,6 @@
/*!
* knockout-daterangepicker
- * version: 0.0.5
+ * version: 0.0.6
* authors: Sensor Tower team
* license: MIT
* https://sensortower.github.io/daterangepicker
@@ -10,7 +10,9 @@
position: absolute;
background: white;
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
- justify-content: flex-start;
+ -webkit-justify-content: flex-start;
+ -ms-flex-pack: start;
+ justify-content: flex-start;
border-radius: 4px;
padding: 4px;
font-size: 13px;
@@ -49,6 +51,8 @@
}
.daterangepicker .periods {
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
display: inline-flex;
margin: 0 auto 8px;
}
@@ -62,9 +66,15 @@
}
.daterangepicker .ranges {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- flex-direction: column;
- align-items: stretch;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-align-items: stretch;
+ -ms-flex-align: stretch;
+ align-items: stretch;
}
.daterangepicker .ranges li {
@@ -74,6 +84,8 @@
}
.daterangepicker .custom-range-inputs {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
margin: -3px;
margin-bottom: 5px;
@@ -82,7 +94,9 @@
.daterangepicker .custom-range-inputs input {
min-width: 50px;
width: 50px;
- flex: 1;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
margin: 3px;
border-radius: 4px;
border: 1px solid #ccc;
@@ -93,6 +107,8 @@
}
.daterangepicker .custom-range-buttons {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
margin: -3px;
}
@@ -145,7 +161,8 @@
.daterangepicker .arrow-left:before {
border-right-width: 6px;
border-right-color: #333;
- transform: translate(-10px, -3.5px);
+ -webkit-transform: translate(-10px, -3.5px);
+ transform: translate(-10px, -3.5px);
}
.daterangepicker .arrow-right {
@@ -155,7 +172,8 @@
.daterangepicker .arrow-right:before {
border-left-width: 6px;
border-left-color: #333;
- transform: translate(6px, -3.5px);
+ -webkit-transform: translate(6px, -3.5px);
+ transform: translate(6px, -3.5px);
}
.daterangepicker.orientation-right:not(.standalone):before {
@@ -218,17 +236,23 @@
}
.daterangepicker select.month-select {
- flex: 10;
+ -webkit-flex: 10;
+ -ms-flex: 10;
+ flex: 10;
max-width: 75%;
}
.daterangepicker select.year-select {
- flex: 11;
+ -webkit-flex: 11;
+ -ms-flex: 11;
+ flex: 11;
max-width: 75%;
}
.daterangepicker select.decade-select {
- flex: 11;
+ -webkit-flex: 11;
+ -ms-flex: 11;
+ flex: 11;
max-width: 75%;
}
@@ -268,21 +292,33 @@
}
.calendar .calendar-header {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
margin: 0 6px 4px;
}
.calendar .calendar-header .calendar-selects {
- flex: 5;
+ -webkit-flex: 5;
+ -ms-flex: 5;
+ flex: 5;
text-align: center;
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- justify-content: center;
- align-items: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
padding: 2px;
}
.calendar .calendar-header .arrow {
- flex: 1;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
text-align: center;
}
@@ -296,22 +332,42 @@
border-radius: 4px;
overflow: hidden;
padding: 5px;
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- align-content: stretch;
- justify-content: space-around;
- flex-direction: column;
+ -webkit-align-content: stretch;
+ -ms-flex-line-pack: stretch;
+ align-content: stretch;
+ -webkit-justify-content: space-around;
+ -ms-flex-pack: distribute;
+ justify-content: space-around;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
}
.calendar .calendar-table .table-row {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- align-content: stretch;
- justify-content: space-around;
- flex: 1;
+ -webkit-align-content: stretch;
+ -ms-flex-line-pack: stretch;
+ align-content: stretch;
+ -webkit-justify-content: space-around;
+ -ms-flex-pack: distribute;
+ justify-content: space-around;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
}
.calendar .calendar-table .table-row .table-col {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- flex: 1;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
text-align: center;
line-height: 1;
cursor: default;
@@ -322,13 +378,21 @@
}
.calendar .calendar-table .table-row .table-col .table-value-wrapper {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- flex: 1;
- align-items: center;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
}
.calendar .calendar-table .table-row .table-col .table-value-wrapper .table-value {
- flex: 1;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
}
.calendar .calendar-table .table-row .table-col.out-of-boundaries, .calendar .calendar-table .table-row .table-col.unavailable,
@@ -371,7 +435,9 @@
}
.calendar .calendar-table .table-row .table-col .week-day {
- flex: 1;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
text-align: center;
}
@@ -380,6 +446,8 @@
}
.daterangepicker.opened {
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
display: inline-flex;
}
@@ -403,8 +471,14 @@
display: none;
}
+.daterangepicker.hide-weekdays .weekdays {
+ display: none;
+}
+
.daterangepicker.single {
- flex-direction: column;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
}
.daterangepicker.single .ranges,
@@ -415,8 +489,12 @@
}
.daterangepicker.single .controls {
+ display: -webkit-flex;
+ display: -ms-flexbox;
display: flex;
- justify-content: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
}
.daterangepicker.single .calendar .calendar-header {
@@ -442,7 +520,9 @@
}
.daterangepicker.quarter-period .table-col {
- flex-direction: column;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
font-size: 2em;
}
@@ -452,5 +532,7 @@
}
.daterangepicker.orientation-left:not(.single) .controls {
- order: 2;
+ -webkit-order: 2;
+ -ms-flex-order: 2;
+ order: 2;
}
diff --git a/dist/daterangepicker.js b/dist/daterangepicker.js
index 60b0fa7..85f8edc 100644
--- a/dist/daterangepicker.js
+++ b/dist/daterangepicker.js
@@ -1,6 +1,6 @@
/*!
* knockout-daterangepicker
- * version: 0.0.5
+ * version: 0.0.6
* authors: Sensor Tower team
* license: MIT
* https://sensortower.github.io/daterangepicker
@@ -296,6 +296,7 @@
this.opened = this._opened(options.opened);
this.expanded = this._expanded(options.expanded);
this.standalone = this._standalone(options.standalone);
+ this.hideWeekdays = this._hideWeekdays(options.hideWeekdays);
this.locale = this._locale(options.locale);
this.orientation = this._orientation(options.orientation);
this.forceUpdate = options.forceUpdate;
@@ -340,7 +341,7 @@
Config.prototype._period = function(val) {
val || (val = this.periods()[0]);
if (val !== 'day' && val !== 'week' && val !== 'month' && val !== 'quarter' && val !== 'year') {
- console.warn("invalid period " + val);
+ throw new Error('Invalid period');
}
return Period.extendObservable(ko.observable(val));
};
@@ -361,6 +362,10 @@
return ko.observable(val || false);
};
+ Config.prototype._hideWeekdays = function(val) {
+ return ko.observable(val || false);
+ };
+
Config.prototype._minDate = function(val) {
var mode, ref;
if (val instanceof Array) {
@@ -392,6 +397,9 @@
Config.prototype._ranges = function(obj) {
var endDate, from, results, startDate, title, to, value;
obj || (obj = this._defaultRanges());
+ if (!$.isPlainObject(obj)) {
+ throw new Error('Invalid ranges parameter (should be a plain object)');
+ }
results = [];
for (title in obj) {
value = obj[title];
@@ -403,9 +411,24 @@
results.push(new CustomDateRange(title));
break;
default:
+ if (!$.isArray(value)) {
+ throw new Error('Value should be an array');
+ }
startDate = value[0], endDate = value[1];
+ if (!startDate) {
+ throw new Error('Missing start date');
+ }
+ if (!endDate) {
+ throw new Error('Missing end date');
+ }
from = MomentUtil.tz(startDate, this.timeZone());
to = MomentUtil.tz(endDate, this.timeZone());
+ if (!from.isValid()) {
+ throw new Error('Invalid start date');
+ }
+ if (!to.isValid()) {
+ throw new Error('Invalid end date');
+ }
results.push(new DateRange(title, from, to));
}
}
@@ -413,18 +436,19 @@
};
Config.prototype._locale = function(val) {
- return val || {
+ return $.extend({
applyButtonTitle: 'Apply',
cancelButtonTitle: 'Cancel',
inputFormat: 'L',
startLabel: 'Start',
endLabel: 'End'
- };
+ }, val || {});
};
Config.prototype._orientation = function(val) {
+ val || (val = 'right');
if (val !== 'right' && val !== 'left') {
- val = 'right';
+ throw new Error('Invalid orientation');
}
return ko.observable(val);
};
@@ -497,6 +521,7 @@
computed.isWithinBoundaries = (function(_this) {
return function(date) {
var between, max, maxExclusive, min, minExclusive, sameMax, sameMin;
+ date = MomentUtil.tz(date, _this.timeZone());
min = minBoundary();
max = maxBoundary();
between = date.isBetween(min, max, _this.period());
@@ -541,6 +566,9 @@
};
Config.prototype._callback = function(val) {
+ if (val && !$.isFunction(val)) {
+ throw new Error('Invalid callback (not a function)');
+ }
return val;
};
@@ -991,9 +1019,10 @@
opened: this.standalone() || this.opened(),
expanded: this.standalone() || this.single() || this.expanded(),
standalone: this.standalone(),
+ 'hide-weekdays': this.hideWeekdays(),
+ 'hide-periods': this.periods().length === 1,
'orientation-left': this.orientation() === 'left',
- 'orientation-right': this.orientation() === 'right',
- 'hide-periods': this.periods().length === 1
+ 'orientation-right': this.orientation() === 'right'
};
ref = Period.allPeriods;
for (j = 0, len = ref.length; j < len; j++) {
diff --git a/dist/daterangepicker.min.css b/dist/daterangepicker.min.css
index 8a1c841..bc3ee13 100644
--- a/dist/daterangepicker.min.css
+++ b/dist/daterangepicker.min.css
@@ -1,7 +1,7 @@
/*!
* knockout-daterangepicker
- * version: 0.0.5
+ * version: 0.0.6
* 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);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: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:flex;flex-direction:column;align-items:stretch}.daterangepicker .ranges li{border-radius:4px;margin-bottom:8px;text-align:left}.daterangepicker .custom-range-inputs{display:flex;margin:-3px -3px 5px}.daterangepicker .custom-range-inputs input{min-width:50px;width:50px;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: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{flex:10;max-width:75%}.daterangepicker select.decade-select,.daterangepicker select.year-select{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:flex;margin:0 6px 4px}.calendar .calendar-header .calendar-selects{flex:5;text-align:center;display:flex;justify-content:center;align-items:center;padding:2px}.calendar .calendar-header .arrow{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:flex;align-content:stretch;justify-content:space-around;flex-direction:column}.calendar .calendar-table .table-row{display:flex;align-content:stretch;justify-content:space-around;flex:1}.calendar .calendar-table .table-row .table-col{display:flex;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:flex;flex:1;align-items:center}.calendar .calendar-table .table-row .table-col .table-value-wrapper .table-value{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{flex:1;text-align:center}.calendar .calendar-table .table-row.weekdays .table-col{font-weight:700}.daterangepicker.opened{display:inline-flex}.daterangepicker.expanded .calendar{display:block}.daterangepicker.hide-periods .calendar .calendar-title,.daterangepicker.hide-periods .periods,.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{flex-direction:column}.daterangepicker.single .controls{display:flex;justify-content:center}.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{flex-direction:column;font-size:2em}.daterangepicker.quarter-period .table-col .months{font-size:.5em;opacity:.75}.daterangepicker.orientation-left:not(.single) .controls{order:2}
\ No newline at end of file
+ */.daterangepicker{display:none;position:absolute;background:#fff;box-shadow:0 2px 15px rgba(0,0,0,.3);-webkit-justify-content:flex-start;-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:-webkit-inline-flex;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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch}.daterangepicker .ranges li{border-radius:4px;margin-bottom:8px;text-align:left}.daterangepicker .custom-range-inputs{display:-webkit-flex;display:-ms-flexbox;display:flex;margin:-3px -3px 5px}.daterangepicker .custom-range-inputs input{min-width:50px;width:50px;-webkit-flex:1;-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:-webkit-flex;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;-webkit-transform:translate(-10px,-3.5px);transform:translate(-10px,-3.5px)}.daterangepicker .arrow-right{margin-right:5px}.daterangepicker .arrow-right:before{border-left-width:6px;border-left-color:#333;-webkit-transform:translate(6px,-3.5px);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{-webkit-flex:10;-ms-flex:10;flex:10;max-width:75%}.daterangepicker select.decade-select,.daterangepicker select.year-select{-webkit-flex:11;-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:-webkit-flex;display:-ms-flexbox;display:flex;margin:0 6px 4px}.calendar .calendar-header .calendar-selects{-webkit-flex:5;-ms-flex:5;flex:5;text-align:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:2px}.calendar .calendar-header .arrow{-webkit-flex:1;-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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-content:stretch;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.calendar .calendar-table .table-row{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-content:stretch;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around;-webkit-flex:1;-ms-flex:1;flex:1}.calendar .calendar-table .table-row .table-col{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-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:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.calendar .calendar-table .table-row .table-col .table-value-wrapper .table-value{-webkit-flex:1;-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{-webkit-flex:1;-ms-flex:1;flex:1;text-align:center}.calendar .calendar-table .table-row.weekdays .table-col{font-weight:700}.daterangepicker.opened{display:-webkit-inline-flex;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{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.daterangepicker.single .controls{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.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{-webkit-flex-direction:column;-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{-webkit-order:2;-ms-flex-order:2;order:2}
\ No newline at end of file
diff --git a/dist/daterangepicker.min.js b/dist/daterangepicker.min.js
index 4b3f735..3fc35a6 100644
--- a/dist/daterangepicker.min.js
+++ b/dist/daterangepicker.min.js
@@ -1,8 +1,8 @@
/*!
* knockout-daterangepicker
- * version: 0.0.5
+ * version: 0.0.6
* 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 n;return t=(t%7+7)%7,moment.localeData().firstDayOfWeek()!==t?(n=t-moment.localeData().firstDayOfWeek(),this.patchCurrentLocale({weekdays:e.rotateArray(moment.weekdays(),n),weekdaysMin:e.rotateArray(moment.weekdaysMin(),n),weekdaysShort:e.rotateArray(moment.weekdaysShort(),n),week:{dow:t,doy:moment.localeData().firstDayOfYear()}})):void 0},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;o>=0?o>=i:i>=o;a=o>=0?++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 t.slice(e).concat(t.slice(0,e))},t.uniqArray=function(t){var e,n,a,r;for(r=[],n=0,a=t.length;a>n;n++)e=t[n],-1===r.indexOf(e)&&r.push(e);return r},t}(),$.fn.daterangepicker=function(t,e){return null==t&&(t={}),this.each(function(){var n;return n=$(this),n.data("daterangepicker")?void 0:(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?!0:!1},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.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.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.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;n=[];for(e in this)a=this[e],this.hasOwnProperty(e)&&"_"!==e[0]&&n.push(t[e]=a);return n},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._period=function(t){return t||(t=this.periods()[0]),"day"!==t&&"week"!==t&&"month"!==t&&"quarter"!==t&&"year"!==t&&console.warn("invalid period "+t),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._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,s,c,d,l;e||(e=this._defaultRanges()),r=[];for(c in e)switch(l=e[c]){case"all-time":r.push(new t(c,this.minDate().clone(),this.maxDate().clone()));break;case"custom":r.push(new i(c));break;default:s=l[0],n=l[1],a=u.tz(s,this.timeZone()),d=u.tz(n,this.timeZone()),r.push(new o(c,a,d))}return r},e.prototype._locale=function(t){return t||{applyButtonTitle:"Apply",cancelButtonTitle:"Cancel",inputFormat:"L",startLabel:"Start",endLabel:"End"}},e.prototype._orientation=function(t){return"right"!==t&&"left"!==t&&(t="right"),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;return t=r.fit(t),e=s(),e&&t.isSame(e)?void 0: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,u,d;return s=n(),i=a(),r=e.isBetween(s,i,t.period()),d=e.isSame(s,t.period()),u=e.isSame(i,t.period()),c="exclusive"===n.mode,o="exclusive"===a.mode,r||!c&&d&&!(o&&u)||!o&&u&&!(c&&d)}}(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){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;return n=t.currentDate().clone().month(e),n.isSame(t.currentDate(),"month")?void 0: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;return n=t.currentDate().clone().year(e),n.isSame(t.currentDate(),"year")?void 0: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;return r=(t.currentDate().year()-t.selectedDecade())%9,a=e+r,n=t.currentDate().clone().year(a),n.isSame(t.currentDate(),"year")?void 0: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;return t=this.firstDate().clone().subtract(1,"millisecond"),{"arrow-hidden":!this.currentDate.isWithinBoundaries(t)}},t.prototype.nextArrowCss=function(){var t,e,n,a;return n=this.period.dimentions(),t=n[0],a=n[1],e=this.firstDate().clone().add(t*a,this.period()),{"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;t>=e?t>=a:a>=t;t>=e?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();a>=t?a>=n:n>=a;a>=t?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.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;return n=u.tz(e,t.locale.inputFormat,t.timeZone()),n.isValid()?t.activeDate(n):void 0}}(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;o>=1?o>=r:r>=o;u=o>=1?++r:--r)s.push(function(){var r,i,o;for(o=[],t=r=1,i=e;i>=1?i>=r:r>=i;t=i>=1?++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 moment.weekdaysMin()},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+"
"+n.join(", ")+""}]}},t.prototype.formatDateTemplate=function(t){return{nodes:$("