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 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.1/daterangepicker.min.js"></script>
22
- <link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.1/daterangepicker.min.css" rel="stylesheet" />
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` then and if the `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` then and if the `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` then and if `invalidDate` return `true`, then an error is logged to console |
708
- | invalidTime | <code>boolean</code> | <code>false</code> | If `true` then and if `invalidTime` return `true`, then an error is logged to console |
709
- | writeWarning | <code>boolean</code> | <code>true</code> | If `true` then a warning is written to console if `startDate` or `endDate` is modified with the exception of rounding due to `timePickerStepSize`. |
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
 
@@ -670,32 +670,32 @@
670
670
  //
671
671
 
672
672
  this.container.find('.drp-calendar')
673
- .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
674
- .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
675
- .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
676
- .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
677
- .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this))
678
- .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this))
679
- .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this));
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', $.proxy(this.clickRange, this))
683
- .on('mouseenter.daterangepicker', 'li', $.proxy(this.hoverRange, this));
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', $.proxy(this.clickApply, this))
687
- .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this));
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': $.proxy(this.show, this),
692
- 'focus.daterangepicker': $.proxy(this.show, this),
693
- 'keyup.daterangepicker': $.proxy(this.elementChanged, this),
694
- 'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility
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', $.proxy(this.toggle, this));
698
- this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this));
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` then and if the `startDate` and `endDate` do not fall into `minDate` and `maxDate`
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` then and if the `startDate` and `endDate` do not fall into `minDate` and `maxSpan`
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` then and if `invalidDate` return `true`, then an error is logged to console
879
- * @property {boolean} invalidTime=false If `true` then and if `invalidTime` return `true`, then an error is logged to console
880
- * @property {boolean} writeWarning=true If `true` then a warning is written to console if `startDate` or `endDate` is modified
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 = $.proxy(function (e) { this.outsideClick(e); }, this);
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', $.proxy(function (e) { this.move(e); }, this));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daterangepicker-4.x",
3
- "version": "4.9.1",
3
+ "version": "4.9.3",
4
4
  "description": "Date range picker with time component and pre-defined ranges",
5
5
  "main": "daterangepicker.js",
6
6
  "style": "daterangepicker.css",