daterangepicker-4.x 4.9.1 → 4.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/daterangepicker.js +24 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ Above samples are based on the [original repository](https://github.com/dangross
|
|
|
18
18
|
```html
|
|
19
19
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
|
|
20
20
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/luxon@3.5.0/build/global/luxon.min.js"></script>
|
|
21
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.
|
|
22
|
-
<link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.
|
|
21
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.3/daterangepicker.min.js"></script>
|
|
22
|
+
<link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.3/daterangepicker.min.css" rel="stylesheet" />
|
|
23
23
|
|
|
24
24
|
<input type="text" id="daterange" />
|
|
25
25
|
|
|
@@ -702,11 +702,11 @@ A single predefined range
|
|
|
702
702
|
| Name | Type | Default | Description |
|
|
703
703
|
| --- | --- | --- | --- |
|
|
704
704
|
| stepSize | <code>boolean</code> | <code>true</code> | If `true`, then `startDate` and `endDate` are rounded to match `timePickerStepSize` (no warning) |
|
|
705
|
-
| minMax | <code>boolean</code> | <code>true</code> | If `true`
|
|
706
|
-
| span | <code>boolean</code> | <code>true</code> | If `true`
|
|
707
|
-
| invalidDate | <code>boolean</code> | <code>false</code> | If `true`
|
|
708
|
-
| invalidTime | <code>boolean</code> | <code>false</code> | If `true`
|
|
709
|
-
| writeWarning | <code>boolean</code> | <code>true</code> | If `true`
|
|
705
|
+
| minMax | <code>boolean</code> | <code>true</code> | If `true` and `startDate` and `endDate` do not fall into `minDate` and `maxDate` then dates are shifted and a warning is written to console. |
|
|
706
|
+
| span | <code>boolean</code> | <code>true</code> | If `true` and `startDate` and `endDate` do not fall into `minDate` and `maxSpan` then `endDate` is shifted and a warning is written to console. |
|
|
707
|
+
| invalidDate | <code>boolean</code> | <code>false</code> | If `true` and `invalidDate` returns `true`, then an error is logged to console |
|
|
708
|
+
| invalidTime | <code>boolean</code> | <code>false</code> | If `true` and `invalidTime` returns `true`, then an error is logged to console |
|
|
709
|
+
| writeWarning | <code>boolean</code> | <code>true</code> | If `true` a warning is written to console if `startDate` or `endDate` is modified with the exception of rounding due to `timePickerStepSize`. |
|
|
710
710
|
|
|
711
711
|
<a name="callback"></a>
|
|
712
712
|
|
package/daterangepicker.js
CHANGED
|
@@ -670,32 +670,32 @@
|
|
|
670
670
|
//
|
|
671
671
|
|
|
672
672
|
this.container.find('.drp-calendar')
|
|
673
|
-
.on('click.daterangepicker', '.prev',
|
|
674
|
-
.on('click.daterangepicker', '.next',
|
|
675
|
-
.on('mousedown.daterangepicker', 'td.available',
|
|
676
|
-
.on('mouseenter.daterangepicker', 'td.available',
|
|
677
|
-
.on('change.daterangepicker', 'select.yearselect',
|
|
678
|
-
.on('change.daterangepicker', 'select.monthselect',
|
|
679
|
-
.on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect',
|
|
673
|
+
.on('click.daterangepicker', '.prev', this.clickPrev.bind(this))
|
|
674
|
+
.on('click.daterangepicker', '.next', this.clickNext.bind(this))
|
|
675
|
+
.on('mousedown.daterangepicker', 'td.available', this.clickDate.bind(this))
|
|
676
|
+
.on('mouseenter.daterangepicker', 'td.available', this.hoverDate.bind(this))
|
|
677
|
+
.on('change.daterangepicker', 'select.yearselect', this.monthOrYearChanged.bind(this))
|
|
678
|
+
.on('change.daterangepicker', 'select.monthselect', this.monthOrYearChanged.bind(this))
|
|
679
|
+
.on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', this.timeChanged.bind(this));
|
|
680
680
|
|
|
681
681
|
this.container.find('.ranges')
|
|
682
|
-
.on('click.daterangepicker', 'li',
|
|
683
|
-
.on('mouseenter.daterangepicker', 'li',
|
|
682
|
+
.on('click.daterangepicker', 'li', this.clickRange.bind(this))
|
|
683
|
+
.on('mouseenter.daterangepicker', 'li', this.hoverRange.bind(this));
|
|
684
684
|
|
|
685
685
|
this.container.find('.drp-buttons')
|
|
686
|
-
.on('click.daterangepicker', 'button.applyBtn',
|
|
687
|
-
.on('click.daterangepicker', 'button.cancelBtn',
|
|
686
|
+
.on('click.daterangepicker', 'button.applyBtn', this.clickApply.bind(this))
|
|
687
|
+
.on('click.daterangepicker', 'button.cancelBtn', this.clickCancel.bind(this));
|
|
688
688
|
|
|
689
689
|
if (this.element.is('input') || this.element.is('button')) {
|
|
690
690
|
this.element.on({
|
|
691
|
-
'click.daterangepicker':
|
|
692
|
-
'focus.daterangepicker':
|
|
693
|
-
'keyup.daterangepicker':
|
|
694
|
-
'keydown.daterangepicker':
|
|
691
|
+
'click.daterangepicker': this.show.bind(this),
|
|
692
|
+
'focus.daterangepicker': this.show.bind(this),
|
|
693
|
+
'keyup.daterangepicker': this.elementChanged.bind(this),
|
|
694
|
+
'keydown.daterangepicker': this.keydown.bind(this) //IE 11 compatibility
|
|
695
695
|
});
|
|
696
696
|
} else {
|
|
697
|
-
this.element.on('click.daterangepicker',
|
|
698
|
-
this.element.on('keydown.daterangepicker',
|
|
697
|
+
this.element.on('click.daterangepicker', this.toggle.bind(this));
|
|
698
|
+
this.element.on('keydown.daterangepicker', this.toggle.bind(this));
|
|
699
699
|
}
|
|
700
700
|
|
|
701
701
|
//
|
|
@@ -871,13 +871,13 @@
|
|
|
871
871
|
* @typedef constraintOptions
|
|
872
872
|
* @type {Object}
|
|
873
873
|
* @property {boolean} stepSize=true If `true`, then `startDate` and `endDate` are rounded to match `timePickerStepSize` (no warning)
|
|
874
|
-
* @property {boolean} minMax=true If `true`
|
|
874
|
+
* @property {boolean} minMax=true If `true` and `startDate` and `endDate` do not fall into `minDate` and `maxDate`
|
|
875
875
|
* then dates are shifted and a warning is written to console.
|
|
876
|
-
* @property {boolean} span=true If `true`
|
|
876
|
+
* @property {boolean} span=true If `true` and `startDate` and `endDate` do not fall into `minDate` and `maxSpan`
|
|
877
877
|
* then `endDate` is shifted and a warning is written to console.
|
|
878
|
-
* @property {boolean} invalidDate=false If `true`
|
|
879
|
-
* @property {boolean} invalidTime=false If `true`
|
|
880
|
-
* @property {boolean} writeWarning=true If `true`
|
|
878
|
+
* @property {boolean} invalidDate=false If `true` and `invalidDate` returns `true`, then an error is logged to console
|
|
879
|
+
* @property {boolean} invalidTime=false If `true` and `invalidTime` returns `true`, then an error is logged to console
|
|
880
|
+
* @property {boolean} writeWarning=true If `true` a warning is written to console if `startDate` or `endDate` is modified
|
|
881
881
|
* with the exception of rounding due to `timePickerStepSize`.
|
|
882
882
|
*/
|
|
883
883
|
|
|
@@ -1801,7 +1801,7 @@
|
|
|
1801
1801
|
if (this.isShowing) return;
|
|
1802
1802
|
|
|
1803
1803
|
// Create a click proxy that is private to this instance of datepicker, for unbinding
|
|
1804
|
-
this._outsideClickProxy =
|
|
1804
|
+
this._outsideClickProxy = function (e) { this.outsideClick(e); }.bind(this);
|
|
1805
1805
|
|
|
1806
1806
|
// Bind global datepicker mousedown for hiding and
|
|
1807
1807
|
$(document)
|
|
@@ -1814,7 +1814,7 @@
|
|
|
1814
1814
|
.on('focusin.daterangepicker', this._outsideClickProxy);
|
|
1815
1815
|
|
|
1816
1816
|
// Reposition the picker if the window is resized while it's open
|
|
1817
|
-
$(window).on('resize.daterangepicker',
|
|
1817
|
+
$(window).on('resize.daterangepicker', function (e) { this.move(e); }.bind(this));
|
|
1818
1818
|
|
|
1819
1819
|
this.oldStartDate = this.startDate;
|
|
1820
1820
|
this.oldEndDate = this.endDate;
|