daterangepicker-4.x 4.9.3 → 4.9.4
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 +6 -6
- package/daterangepicker.js +5 -4
- 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.4/daterangepicker.min.js"></script>
|
|
22
|
+
<link type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker-4.x@4.9.4/daterangepicker.min.css" rel="stylesheet" />
|
|
23
23
|
|
|
24
24
|
<input type="text" id="daterange" />
|
|
25
25
|
|
|
@@ -74,7 +74,7 @@ isInvalidTime: (time, side, unit) => {
|
|
|
74
74
|
color: blue;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
isCustomDate: function(date) {
|
|
78
78
|
if (date.isWeekend)
|
|
79
79
|
return 'daterangepicker-weekend-day';
|
|
80
80
|
|
|
@@ -599,13 +599,13 @@ Options for DateRangePicker
|
|
|
599
599
|
| Name | Type | Default | Description |
|
|
600
600
|
| --- | --- | --- | --- |
|
|
601
601
|
| parentEl | <code>string</code> | <code>"body"</code> | [jQuery selector](https://api.jquery.com/category/selectors/) of the parent element that the date range picker will be added to |
|
|
602
|
-
| startDate | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> | | Default: `DateTime.now().startOf('day')`<br/>The beginning date of the initially selected date range.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`.<br/> Date value is rounded to match option `timePickerStepSize`<br/> Option `isInvalidDate` and `isInvalidTime` are not evaluated, you may set date/time which is not selectable in calendar.<br/> If the date does not fall into `minDate` and `maxDate` then date is shifted and a warning is written to console. |
|
|
602
|
+
| startDate | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> \| <code>null</code> | | Default: `DateTime.now().startOf('day')`<br/>The beginning date of the initially selected date range.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`.<br/> Date value is rounded to match option `timePickerStepSize`<br/> Option `isInvalidDate` and `isInvalidTime` are not evaluated, you may set date/time which is not selectable in calendar.<br/> If the date does not fall into `minDate` and `maxDate` then date is shifted and a warning is written to console.<br/> Use `startDate: null` to show calendar without an inital selected date. |
|
|
603
603
|
| endDate | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> | | Defautl: `DateTime.now().endOf('day')`<br/>The end date of the initially selected date range.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`.<br/> Date value is rounded to match option `timePickerStepSize`<br/> Option `isInvalidDate`, `isInvalidTime` and `minSpan`, `maxSpan` are not evaluated, you may set date/time which is not selectable in calendar.<br/> If the date does not fall into `minDate` and `maxDate` then date is shifted and a warning is written to console.<br/> |
|
|
604
604
|
| minDate | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> \| <code>null</code> | | The earliest date a user may select or `null` for no limit.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`. |
|
|
605
605
|
| maxDate | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> \| <code>null</code> | | The latest date a user may select or `null` for no limit.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`. |
|
|
606
606
|
| minSpan | [<code>Duration</code>](https://moment.github.io/luxon/api-docs/index.html#duration) \| <code>string</code> \| <code>number</code> \| <code>null</code> | | The maximum span between the selected start and end dates.<br/> Must be a `luxon.Duration` or number of seconds or a string according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) duration.<br/> Ignored when `singleDatePicker: true` |
|
|
607
607
|
| maxSpan | [<code>Duration</code>](https://moment.github.io/luxon/api-docs/index.html#duration) \| <code>string</code> \| <code>number</code> \| <code>null</code> | | The minimum span between the selected start and end dates.<br/> Must be a `luxon.Duration` or number of seconds or a string according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) duration.<br/> Ignored when `singleDatePicker: true` |
|
|
608
|
-
| initalMonth | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> \| <code>null</code> | | Default: `DateTime.now().startOf('month')`<br/> The inital month shown when `startDate: null`. Be aware, the attached `<input>` element must be also empty
|
|
608
|
+
| initalMonth | [<code>DateTime</code>](https://moment.github.io/luxon/api-docs/index.html#datetime) \| [<code>Date</code>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) \| <code>string</code> \| <code>null</code> | | Default: `DateTime.now().startOf('month')`<br/> The inital month shown when `startDate: null`. Be aware, the attached `<input>` element must be also empty.<br/> Must be a `luxon.DateTime` or `Date` or `string` according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or a string matching `locale.format`.<br/> When `initalMonth` is used, then `endDate` is ignored and it works only with `timePicker: false` |
|
|
609
609
|
| autoApply | <code>boolean</code> | <code>false</code> | Hide the `Apply` and `Cancel` buttons, and automatically apply a new date range as soon as two dates are clicked.<br/> Only useful when `timePicker: false` |
|
|
610
610
|
| singleDatePicker | <code>boolean</code> | <code>false</code> | Show only a single calendar to choose one date, instead of a range picker with two calendars.<br/> The start and end dates provided to your callback will be the same single date chosen. |
|
|
611
611
|
| singleMonthView | <code>boolean</code> | <code>false</code> | Show only a single month calendar, useful when typically selected ranges are rather short.<br/> Ignored for `singleDatePicker: true`. |
|
|
@@ -627,7 +627,7 @@ Options for DateRangePicker
|
|
|
627
627
|
| 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)` |
|
|
628
628
|
| altInput | <code>string</code> \| <code>Array</code> | <code>null</code> | A [jQuery selector](https://api.jquery.com/category/selectors/) string for an alternative ouput (typically hidden) `<input>` element. Requires `altFormat` to be set.<br/> Must be a single string for `singleDatePicker: true` or an array of two strings for `singleDatePicker: false`<br/> Example: `['#start', '#end']` |
|
|
629
629
|
| altFormat | <code>function</code> \| <code>string</code> | <code></code> | The output format used for `altInput`.<br/> Either a string used with [toFormat()](https://moment.github.io/luxon/api-docs/index.html#datetimetoformat) or a function.<br/> Examples: `'yyyyMMddHHmm'`, `(date) => date.toUnixInteger()` |
|
|
630
|
-
| warnings | <code>boolean</code> | <code>true</code> | When enabled, then warning are printed to console if input date violates `minDate`, `maxDate`, `minSpan`, `maxSpan`, `timePickerStepSize`,
|
|
630
|
+
| warnings | <code>boolean</code> | <code>true</code> | When enabled, then warning are printed to console if input date violates `minDate`, `maxDate`, `minSpan`, `maxSpan`, `timePickerStepSize`, `isInvalidDate`, `isInvalidTime` |
|
|
631
631
|
| applyButtonClasses | <code>string</code> | <code>"btn-primary"</code> | CSS class names that will be added only to the apply button |
|
|
632
632
|
| cancelButtonClasses | <code>string</code> | <code>"btn-default"</code> | CSS class names that will be added only to the cancel button |
|
|
633
633
|
| buttonClasses | <code>string</code> | | Default: `'btn btn-sm'`<br/>CSS class names that will be added to both the apply and cancel buttons. |
|
package/daterangepicker.js
CHANGED
|
@@ -39,11 +39,12 @@
|
|
|
39
39
|
* @typedef Options
|
|
40
40
|
* @property {string} parentEl=body - {@link https://api.jquery.com/category/selectors/|jQuery selector} of the parent element that the date range picker will be added to
|
|
41
41
|
|
|
42
|
-
* @property {external:DateTime|external:Date|string} startDate - Default: `DateTime.now().startOf('day')`<br/>The beginning date of the initially selected date range.<br/>
|
|
42
|
+
* @property {external:DateTime|external:Date|string|null} startDate - Default: `DateTime.now().startOf('day')`<br/>The beginning date of the initially selected date range.<br/>
|
|
43
43
|
* Must be a `luxon.DateTime` or `Date` or `string` according to {@link https://en.wikipedia.org/wiki/ISO_8601|ISO-8601} or a string matching `locale.format`.<br/>
|
|
44
44
|
* Date value is rounded to match option `timePickerStepSize`<br/>
|
|
45
45
|
* Option `isInvalidDate` and `isInvalidTime` are not evaluated, you may set date/time which is not selectable in calendar.<br/>
|
|
46
|
-
* If the date does not fall into `minDate` and `maxDate` then date is shifted and a warning is written to console
|
|
46
|
+
* If the date does not fall into `minDate` and `maxDate` then date is shifted and a warning is written to console.<br/>
|
|
47
|
+
* Use `startDate: null` to show calendar without an inital selected date.
|
|
47
48
|
* @property {external:DateTime|external:Date|string} endDate - Defautl: `DateTime.now().endOf('day')`<br/>The end date of the initially selected date range.<br/>
|
|
48
49
|
* Must be a `luxon.DateTime` or `Date` or `string` according to {@link https://en.wikipedia.org/wiki/ISO_8601|ISO-8601} or a string matching `locale.format`.<br/>
|
|
49
50
|
* Date value is rounded to match option `timePickerStepSize`<br/>
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
* Must be a `luxon.Duration` or number of seconds or a string according to {@link https://en.wikipedia.org/wiki/ISO_8601|ISO-8601} duration.<br/>
|
|
62
63
|
* Ignored when `singleDatePicker: true`
|
|
63
64
|
* @property {external:DateTime|external:Date|string|null} initalMonth - Default: `DateTime.now().startOf('month')`<br/>
|
|
64
|
-
* The inital month shown when `startDate: null`. Be aware, the attached `<input>` element must be also empty
|
|
65
|
+
* The inital month shown when `startDate: null`. Be aware, the attached `<input>` element must be also empty.<br/>
|
|
65
66
|
* Must be a `luxon.DateTime` or `Date` or `string` according to {@link https://en.wikipedia.org/wiki/ISO_8601|ISO-8601} or a string matching `locale.format`.<br/>
|
|
66
67
|
* When `initalMonth` is used, then `endDate` is ignored and it works only with `timePicker: false`
|
|
67
68
|
|
|
@@ -120,7 +121,7 @@
|
|
|
120
121
|
* Either a string used with {@link https://moment.github.io/luxon/api-docs/index.html#datetimetoformat|toFormat()} or a function.<br/>
|
|
121
122
|
* Examples: `'yyyyMMddHHmm'`, `(date) => date.toUnixInteger()`
|
|
122
123
|
* @property {boolean} warnings=true - When enabled, then warning are printed to console if input date violates
|
|
123
|
-
* `minDate`, `maxDate`, `minSpan`, `maxSpan`, `timePickerStepSize`,
|
|
124
|
+
* `minDate`, `maxDate`, `minSpan`, `maxSpan`, `timePickerStepSize`, `isInvalidDate`, `isInvalidTime`
|
|
124
125
|
|
|
125
126
|
* @property {string} applyButtonClasses=btn-primary - CSS class names that will be added only to the apply button
|
|
126
127
|
* @property {string} cancelButtonClasses=btn-default - CSS class names that will be added only to the cancel button
|