Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit f1b0109

Browse files
committed
Version 0.0.5
1 parent 0f7170d commit f1b0109

5 files changed

+24
-16
lines changed

dist/daterangepicker.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* knockout-daterangepicker
3-
* version: 0.0.4
3+
* version: 0.0.5
44
* authors: Sensor Tower team
55
* license: MIT
66
* https://sensortower.github.io/daterangepicker

dist/daterangepicker.js

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* knockout-daterangepicker
3-
* version: 0.0.4
3+
* version: 0.0.5
44
* authors: Sensor Tower team
55
* license: MIT
66
* https://sensortower.github.io/daterangepicker
@@ -20,6 +20,7 @@
2020

2121
MomentUtil.setFirstDayOfTheWeek = function(dow) {
2222
var offset;
23+
dow = (dow % 7 + 7) % 7;
2324
if (moment.localeData().firstDayOfWeek() !== dow) {
2425
offset = dow - moment.localeData().firstDayOfWeek();
2526
return this.patchCurrentLocale({
@@ -429,7 +430,7 @@
429430
};
430431

431432
Config.prototype._dateObservable = function(val, mode, minBoundary, maxBoundary) {
432-
var computed, observable;
433+
var computed, fitMax, fitMin, observable;
433434
observable = ko.observable();
434435
computed = ko.computed({
435436
read: function() {
@@ -447,21 +448,26 @@
447448
})(this)
448449
});
449450
computed.mode = mode || 'inclusive';
450-
computed.fit = (function(_this) {
451+
fitMin = (function(_this) {
451452
return function(val) {
452-
var max, min;
453-
val = MomentUtil.tz(val, _this.timeZone());
453+
var min;
454454
if (minBoundary) {
455455
min = minBoundary();
456456
switch (minBoundary.mode) {
457457
case 'extended':
458458
min = min.clone().startOf(_this.period());
459459
break;
460460
case 'exclusive':
461-
min = min.clone().endOf(_this.period()).subtract(1, 'millisecond');
461+
min = min.clone().endOf(_this.period()).add(1, 'millisecond');
462462
}
463463
val = moment.max(min, val);
464464
}
465+
return val;
466+
};
467+
})(this);
468+
fitMax = (function(_this) {
469+
return function(val) {
470+
var max;
465471
if (maxBoundary) {
466472
max = maxBoundary();
467473
switch (maxBoundary.mode) {
@@ -476,6 +482,12 @@
476482
return val;
477483
};
478484
})(this);
485+
computed.fit = (function(_this) {
486+
return function(val) {
487+
val = MomentUtil.tz(val, _this.timeZone());
488+
return fitMax(fitMin(val));
489+
};
490+
})(this);
479491
computed(val);
480492
computed.clone = (function(_this) {
481493
return function() {
@@ -525,11 +537,7 @@
525537
};
526538

527539
Config.prototype._parentElement = function(val) {
528-
if (this.standalone()) {
529-
return this.anchorElement;
530-
} else {
531-
return $(val || 'body');
532-
}
540+
return $(val || (this.standalone() ? this.anchorElement : 'body'));
533541
};
534542

535543
Config.prototype._callback = function(val) {

dist/daterangepicker.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)