daterangepicker-4.x 4.2.1 → 4.2.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 +48 -22
- package/daterangepicker.js +33 -27
- 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.2.
|
|
22
|
-
<link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.2.
|
|
21
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.2.3/daterangepicker.min.js"></script>
|
|
22
|
+
<link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.2.3/daterangepicker.min.css" rel="stylesheet" />
|
|
23
23
|
|
|
24
24
|
<input type="text" id="daterange" />
|
|
25
25
|
|
|
@@ -107,6 +107,16 @@ In original daterangepicker this parameter defines whether the `<input>` is upda
|
|
|
107
107
|
- Added option `locale.durationFormat` to show customized label for selected duration, e.g. `'4 Days, 6 Hours, 30 Minutes'`
|
|
108
108
|
- ... and maybe some new bugs 😉
|
|
109
109
|
|
|
110
|
+
## Methods
|
|
111
|
+
|
|
112
|
+
Available methods are listed below in [API documentation](#DateRangePicker). You will mainly use
|
|
113
|
+
* [.daterangepicker(options, callback)](#DateRangePicker.daterangepicker)
|
|
114
|
+
* [.setStartDate(startDate)](#DateRangePicker+setStartDate)
|
|
115
|
+
* [.setEndDate(endDate)](#DateRangePicker+setEndDate)
|
|
116
|
+
* [.setPeriod(startDate, endDate)](#DateRangePicker+setPeriod)
|
|
117
|
+
|
|
118
|
+
all other methods are used rarely.
|
|
119
|
+
|
|
110
120
|
### Differences between `moment` and `luxon` library
|
|
111
121
|
This table lists a few important differences between datarangepicker using moment and luxon. Check them carefully when you migrate from older daterangepicker.
|
|
112
122
|
|
|
@@ -154,8 +164,7 @@ Licensed under the [MIT license](LICENSE).
|
|
|
154
164
|
</dd>
|
|
155
165
|
<dt><a href="#event_outsideClick.daterangepicker">"outsideClick.daterangepicker" (this)</a></dt>
|
|
156
166
|
<dd><p>Emitted when user clicks outside the picker.
|
|
157
|
-
|
|
158
|
-
or <a href="#event_cancel.daterangepicker">"cancel.daterangepicker"</a> in your EventHandler.</p>
|
|
167
|
+
Use option <code>onOutsideClick</code> to define the default action, then you may not need to handle this event.</p>
|
|
159
168
|
</dd>
|
|
160
169
|
<dt><a href="#event_showCalendar.daterangepicker">"showCalendar.daterangepicker" (this)</a></dt>
|
|
161
170
|
<dd><p>Emitted when the calendar(s) are shown.
|
|
@@ -208,7 +217,10 @@ use <a href="#event_timeChange.daterangepicker">"timeChange.daterangepicker
|
|
|
208
217
|
* [.setEndDate(endDate, isValid)](#DateRangePicker+setEndDate)
|
|
209
218
|
* [.setPeriod(startDate, endDate, isValid)](#DateRangePicker+setPeriod)
|
|
210
219
|
* [.updateView()](#DateRangePicker+updateView)
|
|
211
|
-
* [.
|
|
220
|
+
* [.showCalendars()](#DateRangePicker+showCalendars)
|
|
221
|
+
* [.hideCalendars()](#DateRangePicker+hideCalendars)
|
|
222
|
+
* [.updateElement()](#DateRangePicker+updateElement)
|
|
223
|
+
* [.remove()](#DateRangePicker+remove)
|
|
212
224
|
* _static_
|
|
213
225
|
* [.daterangepicker(options, callback)](#DateRangePicker.daterangepicker) ⇒
|
|
214
226
|
|
|
@@ -218,7 +230,7 @@ use <a href="#event_timeChange.daterangepicker">"timeChange.daterangepicker
|
|
|
218
230
|
|
|
219
231
|
| Param | Type | Description |
|
|
220
232
|
| --- | --- | --- |
|
|
221
|
-
| element | [<code>jQuery</code>](https://
|
|
233
|
+
| element | [<code>jQuery</code>](https://api.jquery.com/Types/#jQuery/) | jQuery selector of the parent element that the date range picker will be added to |
|
|
222
234
|
| options | [<code>Options</code>](#Options) | Object to configure the DateRangePicker |
|
|
223
235
|
| cb | <code>function</code> | Callback function executed when |
|
|
224
236
|
|
|
@@ -308,18 +320,33 @@ Updates the picker when calendar is initiated or any date has been selected.
|
|
|
308
320
|
Could be useful after running [setStartDate](#DateRangePicker+setStartDate) or [setEndDate](#DateRangePicker+setEndDate)
|
|
309
321
|
|
|
310
322
|
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
311
|
-
<a name="DateRangePicker+
|
|
323
|
+
<a name="DateRangePicker+showCalendars"></a>
|
|
312
324
|
|
|
313
|
-
### dateRangePicker.
|
|
314
|
-
|
|
325
|
+
### dateRangePicker.showCalendars()
|
|
326
|
+
Shows calendar when user selects "Custom Ranges"
|
|
315
327
|
|
|
316
328
|
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
317
|
-
**Emits**: <code>event:"
|
|
329
|
+
**Emits**: <code>event:"showCalendar.daterangepicker"</code>
|
|
330
|
+
<a name="DateRangePicker+hideCalendars"></a>
|
|
318
331
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
332
|
+
### dateRangePicker.hideCalendars()
|
|
333
|
+
Hides calendar when user selects a predefined range
|
|
334
|
+
|
|
335
|
+
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
336
|
+
**Emits**: <code>event:"hideCalendar.daterangepicker"</code>
|
|
337
|
+
<a name="DateRangePicker+updateElement"></a>
|
|
338
|
+
|
|
339
|
+
### dateRangePicker.updateElement()
|
|
340
|
+
Update attached `<input>` element with selected value
|
|
341
|
+
|
|
342
|
+
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
343
|
+
**Emits**: [<code>change</code>](https://api.jquery.com/change/)
|
|
344
|
+
<a name="DateRangePicker+remove"></a>
|
|
345
|
+
|
|
346
|
+
### dateRangePicker.remove()
|
|
347
|
+
Removes the picker from document
|
|
322
348
|
|
|
349
|
+
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
323
350
|
<a name="DateRangePicker.daterangepicker"></a>
|
|
324
351
|
|
|
325
352
|
### DateRangePicker.daterangepicker(options, callback) ⇒
|
|
@@ -331,7 +358,7 @@ Initiate a new DateRangePicker
|
|
|
331
358
|
| Param | Type | Description |
|
|
332
359
|
| --- | --- | --- |
|
|
333
360
|
| options | [<code>Options</code>](#Options) | Object to configure the DateRangePicker |
|
|
334
|
-
| callback | [<code>callback</code>](#callback) | Callback function executed when date is changed. As alternative listen to the ["apply.daterangepicker"](#event_apply.daterangepicker)
|
|
361
|
+
| callback | [<code>callback</code>](#callback) | Callback function executed when date is changed.<br/> Callback function is executed if selected date values has changed, before picker is hidden and before the attached `<input>` element is updated. As alternative listen to the ["apply.daterangepicker"](#event_apply.daterangepicker) event |
|
|
335
362
|
|
|
336
363
|
<a name="event_show.daterangepicker"></a>
|
|
337
364
|
|
|
@@ -371,8 +398,7 @@ Emitted when the picker is hidden
|
|
|
371
398
|
|
|
372
399
|
## "outsideClick.daterangepicker" (this)
|
|
373
400
|
Emitted when user clicks outside the picker.
|
|
374
|
-
|
|
375
|
-
or ["cancel.daterangepicker"](#event_cancel.daterangepicker) in your EventHandler.
|
|
401
|
+
Use option `onOutsideClick` to define the default action, then you may not need to handle this event.
|
|
376
402
|
|
|
377
403
|
**Kind**: event emitted
|
|
378
404
|
|
|
@@ -482,10 +508,10 @@ Options for DateRangePicker
|
|
|
482
508
|
| timePickerSeconds | <code>boolean</code> | <code>boolean</code> | **Deprecated**, use `timePickerStepSize`<br/>Show seconds in the timePicker |
|
|
483
509
|
| timePickerIncrement | <code>boolean</code> | <code>1</code> | **Deprecated**, use `timePickerStepSize`<br/>Increment of the minutes selection list for times |
|
|
484
510
|
| autoUpdateInput | <code>boolean</code> | <code>true</code> | Indicates whether the date range picker should instantly update the value of the attached `<input>` element when the selected dates change.<br/>The `<input>` element will be always updated on `Apply` and reverted when user clicks on `Cancel`. |
|
|
485
|
-
| onOutsideClick | <code>string</code> | <code>"
|
|
511
|
+
| onOutsideClick | <code>string</code> | <code>"apply"</code> | Defines what picker shall do when user clicks outside the calendar. `'apply'` or `'cancel'`. Event [onOutsideClick.daterangepicker](#event_outsideClick.daterangepicker) is always emitted. |
|
|
486
512
|
| linkedCalendars | <code>boolean</code> | <code>true</code> | When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars.<br/> When disabled, the two calendars can be individually advanced and display any month/year |
|
|
487
|
-
| isInvalidDate | <code>function</code> | <code>false</code> | A function that is passed each date in the two calendars before they are displayed,<br/> and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/> Signature: `isInvalidDate(date)
|
|
488
|
-
| isInvalidTime | <code>function</code> | <code>false</code> | A function that is passed each hour/minute/second/am-pm in the two calendars before they are displayed,<br/> and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/> Signature: `isInvalidDate(time, side, unit)`<br/> `side` is 'start' or 'end' or `null` for `singleDatePicker
|
|
513
|
+
| isInvalidDate | <code>function</code> | <code>false</code> | A function that is passed each date in the two calendars before they are displayed,<br/> and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/> Signature: `isInvalidDate(date)`<br/> Function has no effect on date values set by `startDate`, `endDate`, `ranges`, [setStartDate](#DateRangePicker+setStartDate), [setEndDate](#DateRangePicker+setEndDate). |
|
|
514
|
+
| isInvalidTime | <code>function</code> | <code>false</code> | A function that is passed each hour/minute/second/am-pm in the two calendars before they are displayed,<br/> and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/> Signature: `isInvalidDate(time, side, unit)`<br/> `side` is `'start'` or `'end'` or `null` for `singleDatePicker: true`<br/> `unit` is `'hour'`, `'minute'`, `'second'` or `'ampm'`<br/> Hours are always given as 24-hour clock<br/> Function has no effect on time values set by `startDate`, `endDate`, `ranges`, [setStartDate](#DateRangePicker+setStartDate), [setEndDate](#DateRangePicker+setEndDate).<br/> Ensure that your function returns `false` for at least one item. Otherwise the calender is not rendered.<br/> |
|
|
489
515
|
| isCustomDate | <code>function</code> | <code>false</code> | A function that is passed each date in the two calendars before they are displayed, and may return a string or array of CSS class names to apply to that date's calendar cell.<br/> Signature: `isCustomDate(date)` |
|
|
490
516
|
| applyButtonClasses | <code>string</code> | <code>"btn-primary"</code> | CSS class names that will be added only to the apply button |
|
|
491
517
|
| cancelButtonClasses | <code>string</code> | <code>"btn-default"</code> | CSS class names that will be added only to the cancel button |
|
|
@@ -500,9 +526,9 @@ Options for DateRangePicker
|
|
|
500
526
|
| locale.format | <code>object</code> \| <code>string</code> | | Default: `DateTime.DATE_SHORT`<br/>Date formats. Either given as string, see [Format Tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens) or an object according to [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat)<br/> I recommend to use the luxon [Presets](https://moment.github.io/luxon/#/formatting?id=presets). |
|
|
501
527
|
| locale.separator= | <code>string</code> | | Defaut: `' - '` - Separator for start and end time |
|
|
502
528
|
| locale.weekLabel | <code>string</code> | <code>"W"</code> | Label for week numbers |
|
|
503
|
-
| locale.daysOfWeek | <code>Array</code> | | Default: `
|
|
504
|
-
| locale.monthNames | <code>Array</code> | | Default: `Info.months('long')`<br/>Array with month names |
|
|
505
|
-
| locale.firstDay | <code>number</code> | | Default: `Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday |
|
|
529
|
+
| locale.daysOfWeek | <code>Array</code> | | Default: `luxon.weekdays('short')`<br/>Array with weekday names, from Monday to Sunday |
|
|
530
|
+
| locale.monthNames | <code>Array</code> | | Default: `luxon.Info.months('long')`<br/>Array with month names |
|
|
531
|
+
| locale.firstDay | <code>number</code> | | Default: `luxon.Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday |
|
|
506
532
|
| locale.applyLabel | <code>string</code> | <code>"Apply"</code> | Label of `Apply` Button |
|
|
507
533
|
| locale.cancelLabel | <code>string</code> | <code>"Cancel"</code> | Label of `Cancel` Button |
|
|
508
534
|
| locale.customRangeLabel | <code>string</code> | <code>"Custom"</code> | Range - Title for custom ranges |
|
package/daterangepicker.js
CHANGED
|
@@ -89,20 +89,21 @@
|
|
|
89
89
|
|
|
90
90
|
* @property {boolean} autoUpdateInput=true - Indicates whether the date range picker should instantly update the value of the attached `<input>`
|
|
91
91
|
* element when the selected dates change.<br/>The `<input>` element will be always updated on `Apply` and reverted when user clicks on `Cancel`.
|
|
92
|
-
* @property {string} onOutsideClick=
|
|
92
|
+
* @property {string} onOutsideClick=apply - Defines what picker shall do when user clicks outside the calendar.
|
|
93
93
|
* `'apply'` or `'cancel'`. Event {@link #event_outsideClick.daterangepicker|onOutsideClick.daterangepicker} is always emitted.
|
|
94
94
|
* @property {boolean} linkedCalendars=true - When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February),
|
|
95
95
|
* and both will be advanced when clicking the left or right arrows above the calendars.<br/>
|
|
96
96
|
* When disabled, the two calendars can be individually advanced and display any month/year
|
|
97
97
|
* @property {function} isInvalidDate=false - A function that is passed each date in the two calendars before they are displayed,<br/>
|
|
98
98
|
* and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/>
|
|
99
|
-
* Signature: `isInvalidDate(date)
|
|
99
|
+
* Signature: `isInvalidDate(date)`<br/>
|
|
100
100
|
* Function has no effect on date values set by `startDate`, `endDate`, `ranges`, {@link #DateRangePicker+setStartDate|setStartDate}, {@link #DateRangePicker+setEndDate|setEndDate}.
|
|
101
101
|
* @property {function} isInvalidTime=false - A function that is passed each hour/minute/second/am-pm in the two calendars before they are displayed,<br/>
|
|
102
102
|
* and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/>
|
|
103
103
|
* Signature: `isInvalidDate(time, side, unit)`<br/>
|
|
104
|
-
* `side` is 'start' or 'end' or `null` for `singleDatePicker
|
|
104
|
+
* `side` is `'start'` or `'end'` or `null` for `singleDatePicker: true`<br/>
|
|
105
105
|
* `unit` is `'hour'`, `'minute'`, `'second'` or `'ampm'`<br/>
|
|
106
|
+
* Hours are always given as 24-hour clock<br/>
|
|
106
107
|
* Function has no effect on time values set by `startDate`, `endDate`, `ranges`, {@link #DateRangePicker+setStartDate|setStartDate}, {@link #DateRangePicker+setEndDate|setEndDate}.<br/>
|
|
107
108
|
* Ensure that your function returns `false` for at least one item. Otherwise the calender is not rendered.<br/>
|
|
108
109
|
* @property {function} isCustomDate=false - A function that is passed each date in the two calendars before they are displayed,
|
|
@@ -135,9 +136,9 @@
|
|
|
135
136
|
* I recommend to use the luxon [Presets](https://moment.github.io/luxon/#/formatting?id=presets).
|
|
136
137
|
* @property {string} locale.separator= - Defaut: `' - '` - Separator for start and end time
|
|
137
138
|
* @property {string} locale.weekLabel=W - Label for week numbers
|
|
138
|
-
* @property {Array} locale.daysOfWeek - Default: `
|
|
139
|
-
* @property {Array} locale.monthNames - Default: `Info.months('long')`<br/>Array with month names
|
|
140
|
-
* @property {number} locale.firstDay - Default: `Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday
|
|
139
|
+
* @property {Array} locale.daysOfWeek - Default: `luxon.weekdays('short')`<br/>Array with weekday names, from Monday to Sunday
|
|
140
|
+
* @property {Array} locale.monthNames - Default: `luxon.Info.months('long')`<br/>Array with month names
|
|
141
|
+
* @property {number} locale.firstDay - Default: `luxon.Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday
|
|
141
142
|
* @property {string} locale.applyLabel=Apply - Label of `Apply` Button
|
|
142
143
|
* @property {string} locale.cancelLabel=Cancel - Label of `Cancel` Button
|
|
143
144
|
* @property {string} locale.customRangeLabel=Custom Range - Title for custom ranges
|
|
@@ -1045,7 +1046,7 @@
|
|
|
1045
1046
|
},
|
|
1046
1047
|
|
|
1047
1048
|
/**
|
|
1048
|
-
*
|
|
1049
|
+
* Shows calendar months based on selected date values
|
|
1049
1050
|
* @private
|
|
1050
1051
|
*/
|
|
1051
1052
|
updateMonthsInView: function () {
|
|
@@ -1085,7 +1086,7 @@
|
|
|
1085
1086
|
},
|
|
1086
1087
|
|
|
1087
1088
|
/**
|
|
1088
|
-
* Updates the
|
|
1089
|
+
* Updates the selected day value from calendar with selected time values
|
|
1089
1090
|
* @private
|
|
1090
1091
|
*/
|
|
1091
1092
|
updateCalendars: function () {
|
|
@@ -1568,7 +1569,7 @@
|
|
|
1568
1569
|
},
|
|
1569
1570
|
|
|
1570
1571
|
/**
|
|
1571
|
-
*
|
|
1572
|
+
* Disable the `Apply` button if no date value is selected
|
|
1572
1573
|
* @private
|
|
1573
1574
|
*/
|
|
1574
1575
|
updateFormInputs: function () {
|
|
@@ -1581,7 +1582,7 @@
|
|
|
1581
1582
|
},
|
|
1582
1583
|
|
|
1583
1584
|
/**
|
|
1584
|
-
*
|
|
1585
|
+
* Place the picker at the right place in the document
|
|
1585
1586
|
* @private
|
|
1586
1587
|
*/
|
|
1587
1588
|
move: function () {
|
|
@@ -1783,6 +1784,7 @@
|
|
|
1783
1784
|
* Closes the picker when user clicks outside
|
|
1784
1785
|
* @param {external:jQuery} e - The Event target
|
|
1785
1786
|
* @emits "outsideClick.daterangepicker"
|
|
1787
|
+
* @private
|
|
1786
1788
|
*/
|
|
1787
1789
|
outsideClick: function (e) {
|
|
1788
1790
|
var target = $(e.target);
|
|
@@ -1804,8 +1806,7 @@
|
|
|
1804
1806
|
|
|
1805
1807
|
/**
|
|
1806
1808
|
* Emitted when user clicks outside the picker.
|
|
1807
|
-
*
|
|
1808
|
-
* or {@link #event_cancel.daterangepicker|"cancel.daterangepicker"} in your EventHandler.
|
|
1809
|
+
* Use option `onOutsideClick` to define the default action, then you may not need to handle this event.
|
|
1809
1810
|
* @event
|
|
1810
1811
|
* @name "outsideClick.daterangepicker"
|
|
1811
1812
|
* @param {DateRangePicker} this - The daterangepicker object
|
|
@@ -1816,7 +1817,6 @@
|
|
|
1816
1817
|
/**
|
|
1817
1818
|
* Shows calendar when user selects "Custom Ranges"
|
|
1818
1819
|
* @emits "showCalendar.daterangepicker"
|
|
1819
|
-
* @private
|
|
1820
1820
|
*/
|
|
1821
1821
|
showCalendars: function () {
|
|
1822
1822
|
this.container.addClass('show-calendar');
|
|
@@ -1834,7 +1834,6 @@
|
|
|
1834
1834
|
/**
|
|
1835
1835
|
* Hides calendar when user selects a predefined range
|
|
1836
1836
|
* @emits "hideCalendar.daterangepicker"
|
|
1837
|
-
* @private
|
|
1838
1837
|
*/
|
|
1839
1838
|
hideCalendars: function () {
|
|
1840
1839
|
this.container.removeClass('show-calendar');
|
|
@@ -2113,7 +2112,6 @@
|
|
|
2113
2112
|
|
|
2114
2113
|
/**
|
|
2115
2114
|
* Hightlight selected predefined range in calendar
|
|
2116
|
-
* @param {external:jQuery} e - The Event target
|
|
2117
2115
|
* @private
|
|
2118
2116
|
*/
|
|
2119
2117
|
calculateChosenLabel: function () {
|
|
@@ -2309,10 +2307,12 @@
|
|
|
2309
2307
|
},
|
|
2310
2308
|
|
|
2311
2309
|
/**
|
|
2312
|
-
*
|
|
2310
|
+
* Update the picker with value from attached `<input>` element.
|
|
2311
|
+
* Error is written to console if input string cannot be parsed as a valid date/range
|
|
2312
|
+
* @param {external:jQuery} e - The Event target
|
|
2313
2313
|
* @private
|
|
2314
2314
|
*/
|
|
2315
|
-
elementChanged: function () {
|
|
2315
|
+
elementChanged: function (e) {
|
|
2316
2316
|
if (!this.element.is('input')) return;
|
|
2317
2317
|
if (!this.element.val().length) return;
|
|
2318
2318
|
|
|
@@ -2330,7 +2330,10 @@
|
|
|
2330
2330
|
end = start;
|
|
2331
2331
|
}
|
|
2332
2332
|
|
|
2333
|
-
if (!start.isValid || !end.isValid)
|
|
2333
|
+
if (!start.isValid || !end.isValid) {
|
|
2334
|
+
console.error(`Input string '${dateString}' is not valid`);
|
|
2335
|
+
return;
|
|
2336
|
+
}
|
|
2334
2337
|
|
|
2335
2338
|
this.setStartDate(start, false);
|
|
2336
2339
|
this.setEndDate(end, false);
|
|
@@ -2338,7 +2341,7 @@
|
|
|
2338
2341
|
},
|
|
2339
2342
|
|
|
2340
2343
|
/**
|
|
2341
|
-
* Handles key press
|
|
2344
|
+
* Handles key press, IE 11 compatibility
|
|
2342
2345
|
* @param {external:jQuery} e - The Event target
|
|
2343
2346
|
* @private
|
|
2344
2347
|
*/
|
|
@@ -2358,8 +2361,8 @@
|
|
|
2358
2361
|
},
|
|
2359
2362
|
|
|
2360
2363
|
/**
|
|
2361
|
-
* Update
|
|
2362
|
-
* @
|
|
2364
|
+
* Update attached `<input>` element with selected value
|
|
2365
|
+
* @emits external:change
|
|
2363
2366
|
*/
|
|
2364
2367
|
updateElement: function () {
|
|
2365
2368
|
if (this.startDate == null && this.initalMonth)
|
|
@@ -2378,8 +2381,7 @@
|
|
|
2378
2381
|
},
|
|
2379
2382
|
|
|
2380
2383
|
/**
|
|
2381
|
-
*
|
|
2382
|
-
* @private
|
|
2384
|
+
* Removes the picker from document
|
|
2383
2385
|
*/
|
|
2384
2386
|
remove: function () {
|
|
2385
2387
|
this.container.remove();
|
|
@@ -2401,8 +2403,9 @@
|
|
|
2401
2403
|
* @name DateRangePicker.daterangepicker
|
|
2402
2404
|
* @function
|
|
2403
2405
|
* @param {Options} options - Object to configure the DateRangePicker
|
|
2404
|
-
* @param {callback} callback - Callback function executed when date is changed
|
|
2405
|
-
*
|
|
2406
|
+
* @param {callback} callback - Callback function executed when date is changed.<br/>
|
|
2407
|
+
* Callback function is executed if selected date values has changed, before picker is hidden and before the attached `<input>` element is updated.
|
|
2408
|
+
* As alternative listen to the {@link #event_apply.daterangepicker|"apply.daterangepicker"} event
|
|
2406
2409
|
* @returns DateRangePicker
|
|
2407
2410
|
*/
|
|
2408
2411
|
$.fn.daterangepicker = function (options, callback) {
|
|
@@ -2422,10 +2425,13 @@
|
|
|
2422
2425
|
|
|
2423
2426
|
|
|
2424
2427
|
/** @external jQuery
|
|
2425
|
-
@see {@link https://
|
|
2428
|
+
@see {@link https://api.jquery.com/Types/#jQuery/|jQuery} */
|
|
2426
2429
|
|
|
2427
2430
|
/** @external Selector
|
|
2428
|
-
@see {@link https://
|
|
2431
|
+
@see {@link https://api.jquery.com/category/selectors/|jQuery Selector} */
|
|
2432
|
+
|
|
2433
|
+
/** @external change
|
|
2434
|
+
@see {@link https://api.jquery.com/change/|change event} */
|
|
2429
2435
|
|
|
2430
2436
|
/** @external DateTime
|
|
2431
2437
|
@see {@link https://moment.github.io/luxon/api-docs/index.html#datetime|DateTime} */
|