daterangepicker-4.x 4.1.3 → 4.1.5
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 +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -287,7 +287,7 @@ drp.setEndDate('2025-03-28T18:30:00');
|
|
|
287
287
|
<a name="DateRangePicker+setPeriod"></a>
|
|
288
288
|
|
|
289
289
|
### dateRangePicker.setPeriod(startDate, endDate)
|
|
290
|
-
Shortcut for [
|
|
290
|
+
Shortcut for [#DateRangePicker+setStartDatesetStartDate](#DateRangePicker+setStartDatesetStartDate) and [#DateRangePicker+setEndDatesetEndDate](#DateRangePicker+setEndDatesetEndDate)
|
|
291
291
|
|
|
292
292
|
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
293
293
|
**Throws**:
|
|
@@ -310,7 +310,7 @@ drp.setPeriod(DateTime.now().startOf('week'), DateTime.now().startOf('week').plu
|
|
|
310
310
|
|
|
311
311
|
### dateRangePicker.updateView()
|
|
312
312
|
Updates the picker when calendar is initiated or any date has been selected.
|
|
313
|
-
Could be useful after running [
|
|
313
|
+
Could be useful after running [#DateRangePicker+setStartDatesetStartDate](#DateRangePicker+setStartDatesetStartDate) or [#DateRangePicker+setEndDatesetEndDate](#DateRangePicker+setEndDatesetEndDate)
|
|
314
314
|
|
|
315
315
|
**Kind**: instance method of [<code>DateRangePicker</code>](#DateRangePicker)
|
|
316
316
|
<a name="DateRangePicker+outsideClick"></a>
|
|
@@ -488,15 +488,15 @@ Options for DateRangePicker
|
|
|
488
488
|
| autoUpdateInput | <code>boolean</code> | <code>true</code> | Indicates whether the date range picker should automatically update the value of the `<input>` element it's attached to at initialization and when the selected dates change.<br/>Value is reverted when use clicks on `Cancel`. |
|
|
489
489
|
| onOutsideClick | <code>string</code> | <code>"none"</code> | Defines what picker shall do when user clicks outside the calendar. `'apply'` or `'cancel'`. Event [onOutsideClick.daterangepicker](#event_outsideClick.daterangepicker) is always emitted. |
|
|
490
490
|
| 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 |
|
|
491
|
-
| 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)` Function has no effect on date values set by `startDate`, `endDate`, `ranges`, [#
|
|
492
|
-
| 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/> Function has no effect on time values set by `startDate`, `endDate`, `ranges`, [
|
|
491
|
+
| 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)` Function has no effect on date values set by `startDate`, `endDate`, `ranges`, [#DateRangePicker+setStartDatesetStartDate](#DateRangePicker+setStartDatesetStartDate), [#DateRangePicker+setEndDatesetEndDate](#DateRangePicker+setEndDatesetEndDate). |
|
|
492
|
+
| 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/> Function has no effect on time values set by `startDate`, `endDate`, `ranges`, [#DateRangePicker+setStartDatesetStartDate](#DateRangePicker+setStartDatesetStartDate), [#DateRangePicker+setEndDatesetEndDate](#DateRangePicker+setEndDatesetEndDate).<br/> Ensure that your function returns `false` for at least one item. Otherwise the calender is not rendered.<br/> |
|
|
493
493
|
| 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)` |
|
|
494
494
|
| applyButtonClasses | <code>string</code> | <code>"btn-primary"</code> | CSS class names that will be added only to the apply button |
|
|
495
495
|
| cancelButtonClasses | <code>string</code> | <code>"btn-default"</code> | CSS class names that will be added only to the cancel button |
|
|
496
496
|
| buttonClasses | <code>string</code> | <code>"btn"</code> | btn-sm - CSS class names that will be added to both the apply and cancel buttons. |
|
|
497
497
|
| opens | <code>string</code> | <code>"right"</code> | Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to.<br/> `'left' \| 'right' \| 'center'` |
|
|
498
498
|
| drops | <code>string</code> | <code>"down"</code> | Whether the picker appears below or above the HTML element it's attached to.<br/> `'down' \| 'up' \| 'auto'` |
|
|
499
|
-
| ranges | <code>
|
|
499
|
+
| ranges | <code>object</code> | <code>{}</code> | Set predefined date [Ranges](#Ranges) the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range. |
|
|
500
500
|
| showCustomRangeLabel | <code>boolean</code> | <code>true</code> | Displays "Custom Range" at the end of the list of predefined [Ranges](#Ranges), when the ranges option is used.<br> This option will be highlighted whenever the current date range selection does not match one of the predefined ranges.<br/> Clicking it will display the calendars to select a new range. |
|
|
501
501
|
| alwaysShowCalendars | <code>boolean</code> | <code>false</code> | Normally, if you use the ranges option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range".<br/> When this option is set to true, the calendars for choosing a custom date range are always shown instead. |
|
|
502
502
|
| locale | <code>object</code> | <code>{}</code> | Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars. |
|
|
@@ -504,8 +504,8 @@ Options for DateRangePicker
|
|
|
504
504
|
| 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). |
|
|
505
505
|
| locale.separator= | <code>string</code> | | Defaut: `' - '` - Separator for start and end time |
|
|
506
506
|
| locale.weekLabel | <code>string</code> | <code>"W"</code> | Label for week numbers |
|
|
507
|
-
| locale.daysOfWeek | <code>Array
|
|
508
|
-
| locale.monthNames | <code>Array
|
|
507
|
+
| locale.daysOfWeek | <code>Array</code> | | Default: `Info.weekdays('short')`<br/>Array with weekday names, from Monday to Sunday |
|
|
508
|
+
| locale.monthNames | <code>Array</code> | | Default: `Info.months('long')`<br/>Array with month names |
|
|
509
509
|
| locale.firstDay | <code>number</code> | | Default: `Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday |
|
|
510
510
|
| locale.applyLabel | <code>string</code> | <code>"Apply"</code> | Label of `Apply` Button |
|
|
511
511
|
| locale.cancelLabel | <code>string</code> | <code>"Cancel"</code> | Label of `Cancel` Button |
|
package/daterangepicker.js
CHANGED
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
* @property {function} isInvalidDate=false - A function that is passed each date in the two calendars before they are displayed,<br/>
|
|
94
94
|
* and may return `true` or `false` to indicate whether that date should be available for selection or not.<br/>
|
|
95
95
|
* Signature: `isInvalidDate(date)`
|
|
96
|
-
* Function has no effect on date values set by `startDate`, `endDate`, `ranges`, {@link #
|
|
96
|
+
* Function has no effect on date values set by `startDate`, `endDate`, `ranges`, {@link #DateRangePicker+setStartDatesetStartDate}, {@link #DateRangePicker+setEndDatesetEndDate}.
|
|
97
97
|
* @property {function} isInvalidTime=false - A function that is passed each hour/minute/second/am-pm 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
99
|
* Signature: `isInvalidDate(time, side, unit)`<br/>
|
|
100
100
|
* `side` is 'start' or 'end' or `null` for `singleDatePicker = true`<br/>
|
|
101
101
|
* `unit` is `'hour'`, `'minute'`, `'second'` or `'ampm'`<br/>
|
|
102
|
-
* Function has no effect on time values set by `startDate`, `endDate`, `ranges`, {@link #
|
|
102
|
+
* Function has no effect on time values set by `startDate`, `endDate`, `ranges`, {@link #DateRangePicker+setStartDatesetStartDate}, {@link #DateRangePicker+setEndDatesetEndDate}.<br/>
|
|
103
103
|
* Ensure that your function returns `false` for at least one item. Otherwise the calender is not rendered.<br/>
|
|
104
104
|
* @property {function} isCustomDate=false - A function that is passed each date in the two calendars before they are displayed,
|
|
105
105
|
* and may return a string or array of CSS class names to apply to that date's calendar cell.<br/>
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
* @property {string} drops=down - Whether the picker appears below or above the HTML element it's attached to.<br/>
|
|
114
114
|
* `'down' \| 'up' \| 'auto'`
|
|
115
115
|
|
|
116
|
-
* @property {
|
|
116
|
+
* @property {object} ranges={} - Set predefined date {@link #Ranges|Ranges} the user can select from. Each key is the label for the range,
|
|
117
117
|
* and its value an array with two dates representing the bounds of the range.
|
|
118
118
|
* @property {boolean} showCustomRangeLabel=true - Displays "Custom Range" at the end of the list of predefined {@link #Ranges|Ranges},
|
|
119
119
|
* when the ranges option is used.<br>
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
* I recommend to use the luxon [Presets](https://moment.github.io/luxon/#/formatting?id=presets).
|
|
132
132
|
* @property {string} locale.separator= - Defaut: `' - '` - Separator for start and end time
|
|
133
133
|
* @property {string} locale.weekLabel=W - Label for week numbers
|
|
134
|
-
* @property {Array
|
|
135
|
-
* @property {Array
|
|
134
|
+
* @property {Array} locale.daysOfWeek - Default: `Info.weekdays('short')`<br/>Array with weekday names, from Monday to Sunday
|
|
135
|
+
* @property {Array} locale.monthNames - Default: `Info.months('long')`<br/>Array with month names
|
|
136
136
|
* @property {number} locale.firstDay - Default: `Info.getStartOfWeek()`<br/>First day of the week, 1 for Monday through 7 for Sunday
|
|
137
137
|
* @property {string} locale.applyLabel=Apply - Label of `Apply` Button
|
|
138
138
|
* @property {string} locale.cancelLabel=Cancel - Label of `Cancel` Button
|
|
@@ -789,7 +789,7 @@
|
|
|
789
789
|
},
|
|
790
790
|
|
|
791
791
|
/**
|
|
792
|
-
* Shortcut for {@link #
|
|
792
|
+
* Shortcut for {@link #DateRangePicker+setStartDatesetStartDate} and {@link #DateRangePicker+setEndDatesetEndDate}
|
|
793
793
|
* @param {external:DateTime|external:Date|string} startDate - startDate to be set
|
|
794
794
|
* @param {external:DateTime|external:Date|string} endDate - endDate to be set
|
|
795
795
|
* @throws `RangeError` for invalid date values.
|
|
@@ -983,7 +983,7 @@
|
|
|
983
983
|
|
|
984
984
|
/**
|
|
985
985
|
* Updates the picker when calendar is initiated or any date has been selected.
|
|
986
|
-
* Could be useful after running {@link #
|
|
986
|
+
* Could be useful after running {@link #DateRangePicker+setStartDatesetStartDate} or {@link #DateRangePicker+setEndDatesetEndDate}
|
|
987
987
|
*/
|
|
988
988
|
updateView: function () {
|
|
989
989
|
if (this.timePicker) {
|