@js-joda/extra 0.7.0 → 0.8.1
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/CHANGELOG.md +3 -1
- package/dist/js-joda-extra.esm.js +321 -0
- package/dist/js-joda-extra.esm.js.map +1 -0
- package/dist/js-joda-extra.js +282 -476
- package/dist/js-joda-extra.js.map +1 -1
- package/dist/js-joda-extra.min.js +3 -3
- package/package.json +5 -6
- package/src/Interval.js +0 -1
- package/src/license-preamble.js +0 -3
package/dist/js-joda-extra.js
CHANGED
|
@@ -1,523 +1,329 @@
|
|
|
1
|
-
//! @version @js-joda/extra - 0.
|
|
2
|
-
//! @copyright (c) 2015-
|
|
1
|
+
//! @version @js-joda/extra - 0.8.1
|
|
2
|
+
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
5
5
|
|
|
6
|
-
(function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/******/ // The require function
|
|
21
|
-
/******/ function __webpack_require__(moduleId) {
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Check if module is in cache
|
|
24
|
-
/******/ if(installedModules[moduleId]) {
|
|
25
|
-
/******/ return installedModules[moduleId].exports;
|
|
26
|
-
/******/ }
|
|
27
|
-
/******/ // Create a new module (and put it into the cache)
|
|
28
|
-
/******/ var module = installedModules[moduleId] = {
|
|
29
|
-
/******/ i: moduleId,
|
|
30
|
-
/******/ l: false,
|
|
31
|
-
/******/ exports: {}
|
|
32
|
-
/******/ };
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // Execute the module function
|
|
35
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // Flag the module as loaded
|
|
38
|
-
/******/ module.l = true;
|
|
39
|
-
/******/
|
|
40
|
-
/******/ // Return the exports of the module
|
|
41
|
-
/******/ return module.exports;
|
|
42
|
-
/******/ }
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
46
|
-
/******/ __webpack_require__.m = modules;
|
|
47
|
-
/******/
|
|
48
|
-
/******/ // expose the module cache
|
|
49
|
-
/******/ __webpack_require__.c = installedModules;
|
|
50
|
-
/******/
|
|
51
|
-
/******/ // define getter function for harmony exports
|
|
52
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
53
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
54
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
55
|
-
/******/ }
|
|
56
|
-
/******/ };
|
|
57
|
-
/******/
|
|
58
|
-
/******/ // define __esModule on exports
|
|
59
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
60
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
61
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
62
|
-
/******/ }
|
|
63
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
64
|
-
/******/ };
|
|
65
|
-
/******/
|
|
66
|
-
/******/ // create a fake namespace object
|
|
67
|
-
/******/ // mode & 1: value is a module id, require it
|
|
68
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
69
|
-
/******/ // mode & 4: return value when already ns object
|
|
70
|
-
/******/ // mode & 8|1: behave like require
|
|
71
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
72
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
73
|
-
/******/ if(mode & 8) return value;
|
|
74
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
75
|
-
/******/ var ns = Object.create(null);
|
|
76
|
-
/******/ __webpack_require__.r(ns);
|
|
77
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
78
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
79
|
-
/******/ return ns;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
83
|
-
/******/ __webpack_require__.n = function(module) {
|
|
84
|
-
/******/ var getter = module && module.__esModule ?
|
|
85
|
-
/******/ function getDefault() { return module['default']; } :
|
|
86
|
-
/******/ function getModuleExports() { return module; };
|
|
87
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
88
|
-
/******/ return getter;
|
|
89
|
-
/******/ };
|
|
90
|
-
/******/
|
|
91
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
92
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
93
|
-
/******/
|
|
94
|
-
/******/ // __webpack_public_path__
|
|
95
|
-
/******/ __webpack_require__.p = "";
|
|
96
|
-
/******/
|
|
97
|
-
/******/
|
|
98
|
-
/******/ // Load entry module and return exports
|
|
99
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./src/js-joda-extra.js");
|
|
100
|
-
/******/ })
|
|
101
|
-
/************************************************************************/
|
|
102
|
-
/******/ ({
|
|
103
|
-
|
|
104
|
-
/***/ "./src/Interval.js":
|
|
105
|
-
/*!*************************!*\
|
|
106
|
-
!*** ./src/Interval.js ***!
|
|
107
|
-
\*************************/
|
|
108
|
-
/*! exports provided: Interval, _init */
|
|
109
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
110
|
-
|
|
111
|
-
"use strict";
|
|
112
|
-
__webpack_require__.r(__webpack_exports__);
|
|
113
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interval", function() { return Interval; });
|
|
114
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_init", function() { return _init; });
|
|
115
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
116
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
117
|
-
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assert */ "./src/assert.js");
|
|
118
|
-
/*
|
|
119
|
-
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
120
|
-
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
121
|
-
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var Interval = function () {
|
|
126
|
-
Interval.of = function of(startInstant, endInstantOrDuration) {
|
|
127
|
-
if (endInstantOrDuration instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"]) {
|
|
128
|
-
return Interval.ofInstantDuration(startInstant, endInstantOrDuration);
|
|
129
|
-
} else {
|
|
130
|
-
return Interval.ofInstantInstant(startInstant, endInstantOrDuration);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@js-joda/core')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['exports', '@js-joda/core'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JSJodaExtra = {}, global.JSJoda));
|
|
10
|
+
})(this, (function (exports, core) { 'use strict';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
14
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
15
|
+
*/
|
|
16
|
+
function requireNonNull(value, parameterName) {
|
|
17
|
+
if (value == null) {
|
|
18
|
+
throw new core.NullPointerException(parameterName + " must not be null");
|
|
19
|
+
}
|
|
133
20
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function requireInstance(value, _class, parameterName) {
|
|
24
|
+
if (!(value instanceof _class)) {
|
|
25
|
+
throw new core.IllegalArgumentException(parameterName + " must be an instance of " + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ", but is " + value.constructor.name : ''));
|
|
26
|
+
}
|
|
139
27
|
|
|
140
|
-
|
|
141
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('End instant must on or after start instant');
|
|
28
|
+
return value;
|
|
142
29
|
}
|
|
143
30
|
|
|
144
|
-
|
|
145
|
-
|
|
31
|
+
/*
|
|
32
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
33
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
34
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
35
|
+
*/
|
|
36
|
+
var Interval = function () {
|
|
37
|
+
Interval.of = function of(startInstant, endInstantOrDuration) {
|
|
38
|
+
if (endInstantOrDuration instanceof core.Duration) {
|
|
39
|
+
return Interval.ofInstantDuration(startInstant, endInstantOrDuration);
|
|
40
|
+
} else {
|
|
41
|
+
return Interval.ofInstantInstant(startInstant, endInstantOrDuration);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
146
44
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
45
|
+
Interval.ofInstantInstant = function ofInstantInstant(startInclusive, endExclusive) {
|
|
46
|
+
requireNonNull(startInclusive, 'startInclusive');
|
|
47
|
+
requireNonNull(endExclusive, 'endExclusive');
|
|
48
|
+
requireInstance(startInclusive, core.Instant, 'startInclusive');
|
|
49
|
+
requireInstance(endExclusive, core.Instant, 'endExclusive');
|
|
152
50
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
51
|
+
if (endExclusive.isBefore(startInclusive)) {
|
|
52
|
+
throw new core.DateTimeException('End instant must on or after start instant');
|
|
53
|
+
}
|
|
156
54
|
|
|
157
|
-
|
|
158
|
-
|
|
55
|
+
return new Interval(startInclusive, endExclusive);
|
|
56
|
+
};
|
|
159
57
|
|
|
160
|
-
|
|
161
|
-
|
|
58
|
+
Interval.ofInstantDuration = function ofInstantDuration(startInclusive, duration) {
|
|
59
|
+
requireNonNull(startInclusive, 'startInclusive');
|
|
60
|
+
requireNonNull(duration, 'duration');
|
|
61
|
+
requireInstance(startInclusive, core.Instant, 'startInclusive');
|
|
62
|
+
requireInstance(duration, core.Duration, 'duration');
|
|
162
63
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
64
|
+
if (duration.isNegative()) {
|
|
65
|
+
throw new core.DateTimeException('Duration must not be zero or negative');
|
|
66
|
+
}
|
|
166
67
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
var firstChar = text.charAt(0);
|
|
68
|
+
return new Interval(startInclusive, startInclusive.plus(duration));
|
|
69
|
+
};
|
|
170
70
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
71
|
+
Interval.parse = function parse(text) {
|
|
72
|
+
requireNonNull(text, 'text');
|
|
73
|
+
|
|
74
|
+
if (!(typeof text === 'string')) {
|
|
75
|
+
throw new core.IllegalArgumentException("text must be a string, but is " + text.constructor.name);
|
|
76
|
+
}
|
|
177
77
|
|
|
178
|
-
|
|
179
|
-
|
|
78
|
+
for (var i = 0; i < text.length; i += 1) {
|
|
79
|
+
if (text.charAt(i) === '/') {
|
|
80
|
+
var firstChar = text.charAt(0);
|
|
180
81
|
|
|
181
|
-
if (
|
|
182
|
-
var
|
|
82
|
+
if (firstChar === 'P' || firstChar === 'p') {
|
|
83
|
+
var duration = core.Duration.parse(text.substring(0, i));
|
|
84
|
+
var end = core.ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
|
|
85
|
+
return Interval.of(end.minus(duration), end);
|
|
86
|
+
} else {
|
|
87
|
+
var start = core.ZonedDateTime.parse(text.substring(0, i)).toInstant();
|
|
183
88
|
|
|
184
|
-
|
|
89
|
+
if (i + 1 < text.length) {
|
|
90
|
+
var c = text.charAt(i + 1);
|
|
91
|
+
|
|
92
|
+
if (c === 'P' || c === 'p') {
|
|
93
|
+
var _duration = core.Duration.parse(text.substring(i + 1, text.length));
|
|
94
|
+
|
|
95
|
+
return Interval.of(start, start.plus(_duration));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var _end = core.ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();
|
|
100
|
+
|
|
101
|
+
return Interval.of(start, _end);
|
|
185
102
|
}
|
|
186
103
|
}
|
|
104
|
+
}
|
|
187
105
|
|
|
188
|
-
|
|
106
|
+
throw new core.DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);
|
|
107
|
+
};
|
|
189
108
|
|
|
190
|
-
|
|
191
|
-
|
|
109
|
+
function Interval(startInclusive, endExclusive) {
|
|
110
|
+
this._start = startInclusive;
|
|
111
|
+
this._end = endExclusive;
|
|
192
112
|
}
|
|
193
|
-
}
|
|
194
113
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
_proto.intersection = function intersection(other) {
|
|
264
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
265
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
266
|
-
|
|
267
|
-
if (this.isConnected(other) === false) {
|
|
268
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: " + this + " and " + other);
|
|
269
|
-
}
|
|
114
|
+
var _proto = Interval.prototype;
|
|
115
|
+
|
|
116
|
+
_proto.start = function start() {
|
|
117
|
+
return this._start;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
_proto.end = function end() {
|
|
121
|
+
return this._end;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
_proto.isEmpty = function isEmpty() {
|
|
125
|
+
return this._start.equals(this._end);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
_proto.isUnboundedStart = function isUnboundedStart() {
|
|
129
|
+
return this._start.equals(core.Instant.MIN);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
_proto.isUnboundedEnd = function isUnboundedEnd() {
|
|
133
|
+
return this._end.equals(core.Instant.MAX);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
_proto.withStart = function withStart(start) {
|
|
137
|
+
return Interval.of(start, this._end);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
_proto.withEnd = function withEnd(end) {
|
|
141
|
+
return Interval.of(this._start, end);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
_proto.contains = function contains(instant) {
|
|
145
|
+
requireNonNull(instant, 'instant');
|
|
146
|
+
requireInstance(instant, core.Instant, 'instant');
|
|
147
|
+
return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
_proto.encloses = function encloses(other) {
|
|
151
|
+
requireNonNull(other, 'other');
|
|
152
|
+
requireInstance(other, Interval, 'other');
|
|
153
|
+
return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
_proto.abuts = function abuts(other) {
|
|
157
|
+
requireNonNull(other, 'other');
|
|
158
|
+
requireInstance(other, Interval, 'other');
|
|
159
|
+
return !this._end.equals(other.start()) !== !this._start.equals(other.end());
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
_proto.isConnected = function isConnected(other) {
|
|
163
|
+
requireNonNull(other, 'other');
|
|
164
|
+
requireInstance(other, Interval, 'other');
|
|
165
|
+
return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
_proto.overlaps = function overlaps(other) {
|
|
169
|
+
requireNonNull(other, 'other');
|
|
170
|
+
requireInstance(other, Interval, 'other');
|
|
171
|
+
return other.equals(this) || this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
_proto.intersection = function intersection(other) {
|
|
175
|
+
requireNonNull(other, 'other');
|
|
176
|
+
requireInstance(other, Interval, 'other');
|
|
177
|
+
|
|
178
|
+
if (this.isConnected(other) === false) {
|
|
179
|
+
throw new core.DateTimeException("Intervals do not connect: " + this + " and " + other);
|
|
180
|
+
}
|
|
270
181
|
|
|
271
|
-
|
|
182
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
272
183
|
|
|
273
|
-
|
|
184
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
274
185
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
186
|
+
if (cmpStart >= 0 && cmpEnd <= 0) {
|
|
187
|
+
return this;
|
|
188
|
+
} else if (cmpStart <= 0 && cmpEnd >= 0) {
|
|
189
|
+
return other;
|
|
190
|
+
} else {
|
|
191
|
+
var newStart = cmpStart >= 0 ? this._start : other.start();
|
|
192
|
+
var newEnd = cmpEnd <= 0 ? this._end : other.end();
|
|
193
|
+
return Interval.of(newStart, newEnd);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
285
196
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
197
|
+
_proto.union = function union(other) {
|
|
198
|
+
requireNonNull(other, 'other');
|
|
199
|
+
requireInstance(other, Interval, 'other');
|
|
289
200
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
201
|
+
if (this.isConnected(other) === false) {
|
|
202
|
+
throw new core.DateTimeException("Intervals do not connect: " + this + " and " + other);
|
|
203
|
+
}
|
|
293
204
|
|
|
294
|
-
|
|
205
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
295
206
|
|
|
296
|
-
|
|
207
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
297
208
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
209
|
+
if (cmpStart >= 0 && cmpEnd <= 0) {
|
|
210
|
+
return other;
|
|
211
|
+
} else if (cmpStart <= 0 && cmpEnd >= 0) {
|
|
212
|
+
return this;
|
|
213
|
+
} else {
|
|
214
|
+
var newStart = cmpStart >= 0 ? other.start() : this._start;
|
|
215
|
+
var newEnd = cmpEnd <= 0 ? other.end() : this._end;
|
|
216
|
+
return Interval.of(newStart, newEnd);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
308
219
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
220
|
+
_proto.span = function span(other) {
|
|
221
|
+
requireNonNull(other, 'other');
|
|
222
|
+
requireInstance(other, Interval, 'other');
|
|
312
223
|
|
|
313
|
-
|
|
224
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
314
225
|
|
|
315
|
-
|
|
226
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
316
227
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
228
|
+
var newStart = cmpStart >= 0 ? other.start() : this._start;
|
|
229
|
+
var newEnd = cmpEnd <= 0 ? other.end() : this._end;
|
|
230
|
+
return Interval.of(newStart, newEnd);
|
|
231
|
+
};
|
|
321
232
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
233
|
+
_proto.isAfter = function isAfter(instantOrInterval) {
|
|
234
|
+
if (instantOrInterval instanceof core.Instant) {
|
|
235
|
+
return this.isAfterInstant(instantOrInterval);
|
|
236
|
+
} else {
|
|
237
|
+
return this.isAfterInterval(instantOrInterval);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
329
240
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
241
|
+
_proto.isBefore = function isBefore(instantOrInterval) {
|
|
242
|
+
if (instantOrInterval instanceof core.Instant) {
|
|
243
|
+
return this.isBeforeInstant(instantOrInterval);
|
|
244
|
+
} else {
|
|
245
|
+
return this.isBeforeInterval(instantOrInterval);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
337
248
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
249
|
+
_proto.isAfterInstant = function isAfterInstant(instant) {
|
|
250
|
+
return this._start.compareTo(instant) > 0;
|
|
251
|
+
};
|
|
341
252
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
253
|
+
_proto.isBeforeInstant = function isBeforeInstant(instant) {
|
|
254
|
+
return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
|
|
255
|
+
};
|
|
345
256
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
257
|
+
_proto.isAfterInterval = function isAfterInterval(interval) {
|
|
258
|
+
return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
|
|
259
|
+
};
|
|
349
260
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
261
|
+
_proto.isBeforeInterval = function isBeforeInterval(interval) {
|
|
262
|
+
return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
|
|
263
|
+
};
|
|
353
264
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
265
|
+
_proto.toDuration = function toDuration() {
|
|
266
|
+
return core.Duration.between(this._start, this._end);
|
|
267
|
+
};
|
|
357
268
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
269
|
+
_proto.equals = function equals(obj) {
|
|
270
|
+
if (this === obj) {
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (obj instanceof Interval) {
|
|
275
|
+
return this._start.equals(obj.start()) && this._end.equals(obj.end());
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return false;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
_proto.hashCode = function hashCode() {
|
|
282
|
+
return this._start.hashCode() ^ this._end.hashCode();
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
_proto.toString = function toString() {
|
|
286
|
+
return this._start.toString() + "/" + this._end.toString();
|
|
287
|
+
};
|
|
362
288
|
|
|
363
|
-
|
|
364
|
-
|
|
289
|
+
return Interval;
|
|
290
|
+
}();
|
|
291
|
+
function _init() {
|
|
292
|
+
Interval.ALL = Interval.of(core.Instant.MIN, core.Instant.MAX);
|
|
365
293
|
}
|
|
366
294
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
function _init() {
|
|
381
|
-
Interval.ALL = Interval.of(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MIN, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MAX);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/***/ }),
|
|
385
|
-
|
|
386
|
-
/***/ "./src/_init.js":
|
|
387
|
-
/*!**********************!*\
|
|
388
|
-
!*** ./src/_init.js ***!
|
|
389
|
-
\**********************/
|
|
390
|
-
/*! no exports provided */
|
|
391
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
392
|
-
|
|
393
|
-
"use strict";
|
|
394
|
-
__webpack_require__.r(__webpack_exports__);
|
|
395
|
-
/* harmony import */ var _Interval__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interval */ "./src/Interval.js");
|
|
396
|
-
/*
|
|
397
|
-
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
398
|
-
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
399
|
-
*/
|
|
400
|
-
|
|
401
|
-
var isInit = false;
|
|
402
|
-
|
|
403
|
-
function init() {
|
|
404
|
-
if (isInit) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
isInit = true;
|
|
409
|
-
Object(_Interval__WEBPACK_IMPORTED_MODULE_0__["_init"])();
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
init();
|
|
413
|
-
|
|
414
|
-
/***/ }),
|
|
415
|
-
|
|
416
|
-
/***/ "./src/assert.js":
|
|
417
|
-
/*!***********************!*\
|
|
418
|
-
!*** ./src/assert.js ***!
|
|
419
|
-
\***********************/
|
|
420
|
-
/*! exports provided: assert, requireNonNull, requireInstance, abstractMethodFail */
|
|
421
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
422
|
-
|
|
423
|
-
"use strict";
|
|
424
|
-
__webpack_require__.r(__webpack_exports__);
|
|
425
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assert", function() { return assert; });
|
|
426
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requireNonNull", function() { return requireNonNull; });
|
|
427
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "requireInstance", function() { return requireInstance; });
|
|
428
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abstractMethodFail", function() { return abstractMethodFail; });
|
|
429
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
430
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
431
|
-
/**
|
|
432
|
-
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
433
|
-
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
434
|
-
*/
|
|
435
|
-
|
|
436
|
-
function assert(assertion, msg, error) {
|
|
437
|
-
if (!assertion) {
|
|
438
|
-
if (error) {
|
|
439
|
-
throw new error(msg);
|
|
440
|
-
} else {
|
|
441
|
-
throw new Error(msg);
|
|
295
|
+
/*
|
|
296
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
297
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
298
|
+
*/
|
|
299
|
+
var isInit = false;
|
|
300
|
+
|
|
301
|
+
function init() {
|
|
302
|
+
if (isInit) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
isInit = true;
|
|
307
|
+
_init();
|
|
442
308
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
/***/ "./src/js-joda-extra.js":
|
|
466
|
-
/*!******************************!*\
|
|
467
|
-
!*** ./src/js-joda-extra.js ***!
|
|
468
|
-
\******************************/
|
|
469
|
-
/*! exports provided: Interval */
|
|
470
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
471
|
-
|
|
472
|
-
"use strict";
|
|
473
|
-
__webpack_require__.r(__webpack_exports__);
|
|
474
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
475
|
-
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
476
|
-
/* harmony import */ var _Interval__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Interval */ "./src/Interval.js");
|
|
477
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interval", function() { return _Interval__WEBPACK_IMPORTED_MODULE_1__["Interval"]; });
|
|
478
|
-
|
|
479
|
-
/* harmony import */ var _plug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plug */ "./src/plug.js");
|
|
480
|
-
/*
|
|
481
|
-
* @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
482
|
-
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
483
|
-
*/
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
Object(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["use"])(_plug__WEBPACK_IMPORTED_MODULE_2__["default"]);
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
/***/ }),
|
|
491
|
-
|
|
492
|
-
/***/ "./src/plug.js":
|
|
493
|
-
/*!*********************!*\
|
|
494
|
-
!*** ./src/plug.js ***!
|
|
495
|
-
\*********************/
|
|
496
|
-
/*! exports provided: default */
|
|
497
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
498
|
-
|
|
499
|
-
"use strict";
|
|
500
|
-
__webpack_require__.r(__webpack_exports__);
|
|
501
|
-
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_init */ "./src/_init.js");
|
|
502
|
-
/*
|
|
503
|
-
* @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
504
|
-
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
|
-
/* harmony default export */ __webpack_exports__["default"] = (function () {});
|
|
508
|
-
|
|
509
|
-
/***/ }),
|
|
510
|
-
|
|
511
|
-
/***/ "@js-joda/core":
|
|
512
|
-
/*!***************************************************************************************************************!*\
|
|
513
|
-
!*** external {"amd":"@js-joda/core","commonjs":"@js-joda/core","commonjs2":"@js-joda/core","root":"JSJoda"} ***!
|
|
514
|
-
\***************************************************************************************************************/
|
|
515
|
-
/*! no static exports found */
|
|
516
|
-
/***/ (function(module, exports) {
|
|
517
|
-
|
|
518
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__js_joda_core__;
|
|
519
|
-
|
|
520
|
-
/***/ })
|
|
521
|
-
|
|
522
|
-
/******/ });
|
|
523
|
-
});
|
|
309
|
+
|
|
310
|
+
init();
|
|
311
|
+
|
|
312
|
+
/*
|
|
313
|
+
* @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
314
|
+
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
315
|
+
*/
|
|
316
|
+
function plug () {}
|
|
317
|
+
|
|
318
|
+
/*
|
|
319
|
+
* @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
320
|
+
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
321
|
+
*/
|
|
322
|
+
core.use(plug);
|
|
323
|
+
|
|
324
|
+
exports.Interval = Interval;
|
|
325
|
+
|
|
326
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
327
|
+
|
|
328
|
+
}));
|
|
329
|
+
//# sourceMappingURL=js-joda-extra.js.map
|