@js-joda/extra 0.5.0 → 0.7.0
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 +11 -2
- package/dist/js-joda-extra.js +219 -256
- package/dist/js-joda-extra.js.map +1 -1
- package/dist/js-joda-extra.min.js +2 -2
- package/package.json +23 -12
- package/{dist → typings}/js-joda-extra.d.ts +0 -0
- package/examples/usage_browser.html +0 -37
- package/examples/usage_node.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
### next
|
|
5
5
|
|
|
6
|
+
### 0.7.0
|
|
7
|
+
|
|
8
|
+
* [#574](https://github.com/js-joda/js-joda/pull/574) Reverting babel targets for UMD ([@pithu](https://github.com/pithu))
|
|
9
|
+
|
|
10
|
+
### 0.6.0
|
|
11
|
+
|
|
12
|
+
* [#567](https://github.com/js-joda/js-joda/pull/567) Remove generated distributions files from git ([@pithu](https://github.com/pithu))
|
|
13
|
+
* [#564](https://github.com/js-joda/js-joda/pull/564) Fix travis for PR's from forks ([@pithu](https://github.com/pithu))
|
|
14
|
+
|
|
6
15
|
### 0.5.0
|
|
7
16
|
|
|
8
17
|
* Upgrade dependencies #555 by @pithu
|
|
@@ -25,7 +34,7 @@
|
|
|
25
34
|
#### public api
|
|
26
35
|
|
|
27
36
|
* hide `use(plug)` from public api, that is done automatically from now on.
|
|
28
|
-
* Interval must be imported from js-joda
|
|
37
|
+
* Interval must be imported from @js-joda/extra, it's not added to js-joda anymore.
|
|
29
38
|
|
|
30
39
|
### 0.1.1
|
|
31
40
|
|
|
@@ -40,7 +49,7 @@
|
|
|
40
49
|
|
|
41
50
|
### 0.0.3
|
|
42
51
|
|
|
43
|
-
* add and use babel-plugin-add-module-exports to get rid of having to use `.default` when `.use`ing js-joda
|
|
52
|
+
* add and use babel-plugin-add-module-exports to get rid of having to use `.default` when `.use`ing @js-joda/extra
|
|
44
53
|
|
|
45
54
|
### 0.0.2
|
|
46
55
|
|
package/dist/js-joda-extra.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/extra - 0.
|
|
1
|
+
//! @version @js-joda/extra - 0.7.0
|
|
2
2
|
//! @copyright (c) 2015-2016, 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)
|
|
@@ -115,12 +115,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
115
115
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
116
116
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
117
117
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assert */ "./src/assert.js");
|
|
118
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
119
|
-
|
|
120
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
121
|
-
|
|
122
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
123
|
-
|
|
124
118
|
/*
|
|
125
119
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
126
120
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -129,288 +123,257 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
129
123
|
|
|
130
124
|
|
|
131
125
|
var Interval = function () {
|
|
132
|
-
function
|
|
133
|
-
|
|
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
|
+
};
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
Interval.ofInstantInstant = function ofInstantInstant(startInclusive, endExclusive) {
|
|
135
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(startInclusive, 'startInclusive');
|
|
136
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(endExclusive, 'endExclusive');
|
|
137
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(startInclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'startInclusive');
|
|
138
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(endExclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'endExclusive');
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
value: function start() {
|
|
142
|
-
return this._start;
|
|
143
|
-
}
|
|
144
|
-
}, {
|
|
145
|
-
key: "end",
|
|
146
|
-
value: function end() {
|
|
147
|
-
return this._end;
|
|
140
|
+
if (endExclusive.isBefore(startInclusive)) {
|
|
141
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('End instant must on or after start instant');
|
|
148
142
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
value: function isUnboundedEnd() {
|
|
162
|
-
return this._end.equals(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MAX);
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
|
-
key: "withStart",
|
|
166
|
-
value: function withStart(start) {
|
|
167
|
-
return Interval.of(start, this._end);
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "withEnd",
|
|
171
|
-
value: function withEnd(end) {
|
|
172
|
-
return Interval.of(this._start, end);
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
key: "contains",
|
|
176
|
-
value: function contains(instant) {
|
|
177
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(instant, 'instant');
|
|
178
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(instant, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'instant');
|
|
179
|
-
return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
182
|
-
key: "encloses",
|
|
183
|
-
value: function encloses(other) {
|
|
184
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
185
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
186
|
-
return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
|
|
187
|
-
}
|
|
188
|
-
}, {
|
|
189
|
-
key: "abuts",
|
|
190
|
-
value: function abuts(other) {
|
|
191
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
192
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
193
|
-
return !this._end.equals(other.start()) !== !this._start.equals(other.end());
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
196
|
-
key: "isConnected",
|
|
197
|
-
value: function isConnected(other) {
|
|
198
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
199
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
200
|
-
return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
|
|
143
|
+
|
|
144
|
+
return new Interval(startInclusive, endExclusive);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
Interval.ofInstantDuration = function ofInstantDuration(startInclusive, duration) {
|
|
148
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(startInclusive, 'startInclusive');
|
|
149
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(duration, 'duration');
|
|
150
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(startInclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'startInclusive');
|
|
151
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(duration, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"], 'duration');
|
|
152
|
+
|
|
153
|
+
if (duration.isNegative()) {
|
|
154
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Duration must not be zero or negative');
|
|
201
155
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
156
|
+
|
|
157
|
+
return new Interval(startInclusive, startInclusive.plus(duration));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
Interval.parse = function parse(text) {
|
|
161
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(text, 'text');
|
|
162
|
+
|
|
163
|
+
if (!(typeof text === 'string')) {
|
|
164
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("text must be a string, but is " + text.constructor.name);
|
|
208
165
|
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "intersection",
|
|
211
|
-
value: function intersection(other) {
|
|
212
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
213
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
214
|
-
|
|
215
|
-
if (this.isConnected(other) === false) {
|
|
216
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: ".concat(this, " and ").concat(other));
|
|
217
|
-
}
|
|
218
166
|
|
|
219
|
-
|
|
167
|
+
for (var i = 0; i < text.length; i += 1) {
|
|
168
|
+
if (text.charAt(i) === '/') {
|
|
169
|
+
var firstChar = text.charAt(0);
|
|
170
|
+
|
|
171
|
+
if (firstChar === 'P' || firstChar === 'p') {
|
|
172
|
+
var duration = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].parse(text.substring(0, i));
|
|
173
|
+
var end = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(i + 1, text.length)).toInstant();
|
|
174
|
+
return Interval.of(end.minus(duration), end);
|
|
175
|
+
} else {
|
|
176
|
+
var start = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(0, i)).toInstant();
|
|
177
|
+
|
|
178
|
+
if (i + 1 < text.length) {
|
|
179
|
+
var c = text.charAt(i + 1);
|
|
180
|
+
|
|
181
|
+
if (c === 'P' || c === 'p') {
|
|
182
|
+
var _duration = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].parse(text.substring(i + 1, text.length));
|
|
183
|
+
|
|
184
|
+
return Interval.of(start, start.plus(_duration));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
220
187
|
|
|
221
|
-
|
|
188
|
+
var _end = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(i + 1, text.length)).toInstant();
|
|
222
189
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
} else if (cmpStart <= 0 && cmpEnd >= 0) {
|
|
226
|
-
return other;
|
|
227
|
-
} else {
|
|
228
|
-
var newStart = cmpStart >= 0 ? this._start : other.start();
|
|
229
|
-
var newEnd = cmpEnd <= 0 ? this._end : other.end();
|
|
230
|
-
return Interval.of(newStart, newEnd);
|
|
190
|
+
return Interval.of(start, _end);
|
|
191
|
+
}
|
|
231
192
|
}
|
|
232
193
|
}
|
|
233
|
-
}, {
|
|
234
|
-
key: "union",
|
|
235
|
-
value: function union(other) {
|
|
236
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
237
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
238
|
-
|
|
239
|
-
if (this.isConnected(other) === false) {
|
|
240
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: ".concat(this, " and ").concat(other));
|
|
241
|
-
}
|
|
242
194
|
|
|
243
|
-
|
|
195
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeParseException"]('Interval cannot be parsed, no forward slash found', text, 0);
|
|
196
|
+
};
|
|
244
197
|
|
|
245
|
-
|
|
198
|
+
function Interval(startInclusive, endExclusive) {
|
|
199
|
+
this._start = startInclusive;
|
|
200
|
+
this._end = endExclusive;
|
|
201
|
+
}
|
|
246
202
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
203
|
+
var _proto = Interval.prototype;
|
|
204
|
+
|
|
205
|
+
_proto.start = function start() {
|
|
206
|
+
return this._start;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
_proto.end = function end() {
|
|
210
|
+
return this._end;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
_proto.isEmpty = function isEmpty() {
|
|
214
|
+
return this._start.equals(this._end);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
_proto.isUnboundedStart = function isUnboundedStart() {
|
|
218
|
+
return this._start.equals(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MIN);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
_proto.isUnboundedEnd = function isUnboundedEnd() {
|
|
222
|
+
return this._end.equals(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].MAX);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
_proto.withStart = function withStart(start) {
|
|
226
|
+
return Interval.of(start, this._end);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
_proto.withEnd = function withEnd(end) {
|
|
230
|
+
return Interval.of(this._start, end);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
_proto.contains = function contains(instant) {
|
|
234
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(instant, 'instant');
|
|
235
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(instant, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'instant');
|
|
236
|
+
return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
_proto.encloses = function encloses(other) {
|
|
240
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
241
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
242
|
+
return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
_proto.abuts = function abuts(other) {
|
|
246
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
247
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
248
|
+
return !this._end.equals(other.start()) !== !this._start.equals(other.end());
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
_proto.isConnected = function isConnected(other) {
|
|
252
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
253
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
254
|
+
return this.equals(other) || this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
_proto.overlaps = function overlaps(other) {
|
|
258
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
259
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
260
|
+
return other.equals(this) || this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0;
|
|
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);
|
|
256
269
|
}
|
|
257
|
-
}, {
|
|
258
|
-
key: "span",
|
|
259
|
-
value: function span(other) {
|
|
260
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
261
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
262
270
|
|
|
263
|
-
|
|
271
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
264
272
|
|
|
265
|
-
|
|
273
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
266
274
|
|
|
267
|
-
|
|
268
|
-
|
|
275
|
+
if (cmpStart >= 0 && cmpEnd <= 0) {
|
|
276
|
+
return this;
|
|
277
|
+
} else if (cmpStart <= 0 && cmpEnd >= 0) {
|
|
278
|
+
return other;
|
|
279
|
+
} else {
|
|
280
|
+
var newStart = cmpStart >= 0 ? this._start : other.start();
|
|
281
|
+
var newEnd = cmpEnd <= 0 ? this._end : other.end();
|
|
269
282
|
return Interval.of(newStart, newEnd);
|
|
270
283
|
}
|
|
271
|
-
}
|
|
272
|
-
key: "isAfter",
|
|
273
|
-
value: function isAfter(instantOrInterval) {
|
|
274
|
-
if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
|
|
275
|
-
return this.isAfterInstant(instantOrInterval);
|
|
276
|
-
} else {
|
|
277
|
-
return this.isAfterInterval(instantOrInterval);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}, {
|
|
281
|
-
key: "isBefore",
|
|
282
|
-
value: function isBefore(instantOrInterval) {
|
|
283
|
-
if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
|
|
284
|
-
return this.isBeforeInstant(instantOrInterval);
|
|
285
|
-
} else {
|
|
286
|
-
return this.isBeforeInterval(instantOrInterval);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}, {
|
|
290
|
-
key: "isAfterInstant",
|
|
291
|
-
value: function isAfterInstant(instant) {
|
|
292
|
-
return this._start.compareTo(instant) > 0;
|
|
293
|
-
}
|
|
294
|
-
}, {
|
|
295
|
-
key: "isBeforeInstant",
|
|
296
|
-
value: function isBeforeInstant(instant) {
|
|
297
|
-
return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
|
|
298
|
-
}
|
|
299
|
-
}, {
|
|
300
|
-
key: "isAfterInterval",
|
|
301
|
-
value: function isAfterInterval(interval) {
|
|
302
|
-
return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
|
|
303
|
-
}
|
|
304
|
-
}, {
|
|
305
|
-
key: "isBeforeInterval",
|
|
306
|
-
value: function isBeforeInterval(interval) {
|
|
307
|
-
return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
|
|
308
|
-
}
|
|
309
|
-
}, {
|
|
310
|
-
key: "toDuration",
|
|
311
|
-
value: function toDuration() {
|
|
312
|
-
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].between(this._start, this._end);
|
|
313
|
-
}
|
|
314
|
-
}, {
|
|
315
|
-
key: "equals",
|
|
316
|
-
value: function equals(obj) {
|
|
317
|
-
if (this === obj) {
|
|
318
|
-
return true;
|
|
319
|
-
}
|
|
284
|
+
};
|
|
320
285
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
286
|
+
_proto.union = function union(other) {
|
|
287
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
288
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
324
289
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}, {
|
|
328
|
-
key: "hashCode",
|
|
329
|
-
value: function hashCode() {
|
|
330
|
-
return this._start.hashCode() ^ this._end.hashCode();
|
|
290
|
+
if (this.isConnected(other) === false) {
|
|
291
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Intervals do not connect: " + this + " and " + other);
|
|
331
292
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
293
|
+
|
|
294
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
295
|
+
|
|
296
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
297
|
+
|
|
298
|
+
if (cmpStart >= 0 && cmpEnd <= 0) {
|
|
299
|
+
return other;
|
|
300
|
+
} else if (cmpStart <= 0 && cmpEnd >= 0) {
|
|
301
|
+
return this;
|
|
302
|
+
} else {
|
|
303
|
+
var newStart = cmpStart >= 0 ? other.start() : this._start;
|
|
304
|
+
var newEnd = cmpEnd <= 0 ? other.end() : this._end;
|
|
305
|
+
return Interval.of(newStart, newEnd);
|
|
345
306
|
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (endExclusive.isBefore(startInclusive)) {
|
|
355
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('End instant must on or after start instant');
|
|
356
|
-
}
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
_proto.span = function span(other) {
|
|
310
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(other, 'other');
|
|
311
|
+
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(other, Interval, 'other');
|
|
312
|
+
|
|
313
|
+
var cmpStart = this._start.compareTo(other.start());
|
|
357
314
|
|
|
358
|
-
|
|
315
|
+
var cmpEnd = this._end.compareTo(other.end());
|
|
316
|
+
|
|
317
|
+
var newStart = cmpStart >= 0 ? other.start() : this._start;
|
|
318
|
+
var newEnd = cmpEnd <= 0 ? other.end() : this._end;
|
|
319
|
+
return Interval.of(newStart, newEnd);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
_proto.isAfter = function isAfter(instantOrInterval) {
|
|
323
|
+
if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
|
|
324
|
+
return this.isAfterInstant(instantOrInterval);
|
|
325
|
+
} else {
|
|
326
|
+
return this.isAfterInterval(instantOrInterval);
|
|
359
327
|
}
|
|
360
|
-
}
|
|
361
|
-
key: "ofInstantDuration",
|
|
362
|
-
value: function ofInstantDuration(startInclusive, duration) {
|
|
363
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(startInclusive, 'startInclusive');
|
|
364
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(duration, 'duration');
|
|
365
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(startInclusive, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"], 'startInclusive');
|
|
366
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireInstance"])(duration, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"], 'duration');
|
|
367
|
-
|
|
368
|
-
if (duration.isNegative()) {
|
|
369
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Duration must not be zero or negative');
|
|
370
|
-
}
|
|
328
|
+
};
|
|
371
329
|
|
|
372
|
-
|
|
330
|
+
_proto.isBefore = function isBefore(instantOrInterval) {
|
|
331
|
+
if (instantOrInterval instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"]) {
|
|
332
|
+
return this.isBeforeInstant(instantOrInterval);
|
|
333
|
+
} else {
|
|
334
|
+
return this.isBeforeInterval(instantOrInterval);
|
|
373
335
|
}
|
|
374
|
-
}
|
|
375
|
-
key: "parse",
|
|
376
|
-
value: function parse(text) {
|
|
377
|
-
Object(_assert__WEBPACK_IMPORTED_MODULE_1__["requireNonNull"])(text, 'text');
|
|
336
|
+
};
|
|
378
337
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
338
|
+
_proto.isAfterInstant = function isAfterInstant(instant) {
|
|
339
|
+
return this._start.compareTo(instant) > 0;
|
|
340
|
+
};
|
|
382
341
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
342
|
+
_proto.isBeforeInstant = function isBeforeInstant(instant) {
|
|
343
|
+
return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;
|
|
344
|
+
};
|
|
386
345
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return Interval.of(end.minus(duration), end);
|
|
391
|
-
} else {
|
|
392
|
-
var start = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZonedDateTime"].parse(text.substring(0, i)).toInstant();
|
|
346
|
+
_proto.isAfterInterval = function isAfterInterval(interval) {
|
|
347
|
+
return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);
|
|
348
|
+
};
|
|
393
349
|
|
|
394
|
-
|
|
395
|
-
|
|
350
|
+
_proto.isBeforeInterval = function isBeforeInterval(interval) {
|
|
351
|
+
return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);
|
|
352
|
+
};
|
|
396
353
|
|
|
397
|
-
|
|
398
|
-
|
|
354
|
+
_proto.toDuration = function toDuration() {
|
|
355
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Duration"].between(this._start, this._end);
|
|
356
|
+
};
|
|
399
357
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
358
|
+
_proto.equals = function equals(obj) {
|
|
359
|
+
if (this === obj) {
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
403
362
|
|
|
404
|
-
|
|
363
|
+
if (obj instanceof Interval) {
|
|
364
|
+
return this._start.equals(obj.start()) && this._end.equals(obj.end());
|
|
365
|
+
}
|
|
405
366
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
}
|
|
367
|
+
return false;
|
|
368
|
+
};
|
|
410
369
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
370
|
+
_proto.hashCode = function hashCode() {
|
|
371
|
+
return this._start.hashCode() ^ this._end.hashCode();
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
_proto.toString = function toString() {
|
|
375
|
+
return this._start.toString() + "/" + this._end.toString();
|
|
376
|
+
};
|
|
414
377
|
|
|
415
378
|
return Interval;
|
|
416
379
|
}();
|
|
@@ -481,20 +444,20 @@ function assert(assertion, msg, error) {
|
|
|
481
444
|
}
|
|
482
445
|
function requireNonNull(value, parameterName) {
|
|
483
446
|
if (value == null) {
|
|
484
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["NullPointerException"](
|
|
447
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["NullPointerException"](parameterName + " must not be null");
|
|
485
448
|
}
|
|
486
449
|
|
|
487
450
|
return value;
|
|
488
451
|
}
|
|
489
452
|
function requireInstance(value, _class, parameterName) {
|
|
490
453
|
if (!(value instanceof _class)) {
|
|
491
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"](
|
|
454
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"](parameterName + " must be an instance of " + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ", but is " + value.constructor.name : ''));
|
|
492
455
|
}
|
|
493
456
|
|
|
494
457
|
return value;
|
|
495
458
|
}
|
|
496
459
|
function abstractMethodFail(methodName) {
|
|
497
|
-
throw new TypeError("abstract method \""
|
|
460
|
+
throw new TypeError("abstract method \"" + methodName + "\" is not implemented");
|
|
498
461
|
}
|
|
499
462
|
|
|
500
463
|
/***/ }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://JSJodaExtra/webpack/universalModuleDefinition","webpack://JSJodaExtra/webpack/bootstrap","webpack://JSJodaExtra/./src/Interval.js","webpack://JSJodaExtra/./src/_init.js","webpack://JSJodaExtra/./src/assert.js","webpack://JSJodaExtra/./src/js-joda-extra.js","webpack://JSJodaExtra/./src/plug.js","webpack://JSJodaExtra/external {\"amd\":\"@js-joda/core\",\"commonjs\":\"@js-joda/core\",\"commonjs2\":\"@js-joda/core\",\"root\":\"JSJoda\"}"],"names":["Interval","startInclusive","endExclusive","_start","_end","equals","Instant","MIN","MAX","start","of","end","instant","requireNonNull","requireInstance","compareTo","isUnboundedEnd","other","isConnected","DateTimeException","cmpStart","cmpEnd","newStart","newEnd","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","Duration","between","obj","hashCode","toString","startInstant","endInstantOrDuration","ofInstantDuration","ofInstantInstant","isBefore","duration","isNegative","plus","text","IllegalArgumentException","constructor","name","i","length","charAt","firstChar","parse","substring","ZonedDateTime","toInstant","minus","c","DateTimeParseException","_init","ALL","isInit","init","intervalInit","assert","assertion","msg","error","Error","value","parameterName","NullPointerException","_class","abstractMethodFail","methodName","TypeError","use","plug"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AAGA;AAGA;AAgBO,IAAMA,QAAb;AAgII,oBAAYC,cAAZ,EAA4BC,YAA5B,EAA0C;AAAA;;AACtC,SAAKC,MAAL,GAAcF,cAAd;AACA,SAAKG,IAAL,GAAYF,YAAZ;AACH;;AAnIL;AAAA;AAAA,WA8II,iBAAQ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B,WAAN,CAAkBC,IAAhD,sBAAmEsB,KAAK,CAACvB,WAAN,CAAkBC,IAArF,IAA8F,EAA3M,EAAN;AACH;;AACD,SAAOsB,KAAP;AACH;AAOM,SAASI,kBAAT,CAA4BC,UAA5B,EAAwC;AAC3C,QAAM,IAAIC,SAAJ,6BAAkCD,UAAlC,2BAAN;AACH,C;;;;;;;;;;;;AC5DD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEAE,yDAAG,CAACC,6CAAD,CAAH;;;;;;;;;;;;;ACVA;AAAA;AAAA;AACA;AACA;AACA;AAIA;AAOe,2EAAwB,CAGtC,C;;;;;;;;;;;ACjBD,2D","file":"js-joda-extra.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@js-joda/core\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@js-joda/core\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"JSJodaExtra\"] = factory(require(\"@js-joda/core\"));\n\telse\n\t\troot[\"JSJodaExtra\"] = factory(root[\"JSJoda\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__js_joda_core__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/js-joda-extra.js\");\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/* eslint-disable no-else-return */\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n intervalInit();\n}\n\ninit();\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n Interval,\n};\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.Interval = Interval;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__js_joda_core__;"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://JSJodaExtra/webpack/universalModuleDefinition","webpack://JSJodaExtra/webpack/bootstrap","webpack://JSJodaExtra/./src/Interval.js","webpack://JSJodaExtra/./src/_init.js","webpack://JSJodaExtra/./src/assert.js","webpack://JSJodaExtra/./src/js-joda-extra.js","webpack://JSJodaExtra/./src/plug.js","webpack://JSJodaExtra/external {\"amd\":\"@js-joda/core\",\"commonjs\":\"@js-joda/core\",\"commonjs2\":\"@js-joda/core\",\"root\":\"JSJoda\"}"],"names":["Interval","of","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","requireNonNull","requireInstance","Instant","isBefore","DateTimeException","duration","isNegative","plus","parse","text","IllegalArgumentException","constructor","name","i","length","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","equals","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","compareTo","encloses","other","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","obj","hashCode","toString","_init","ALL","isInit","init","intervalInit","assert","assertion","msg","error","Error","value","parameterName","NullPointerException","_class","abstractMethodFail","methodName","TypeError","use","plug"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAA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ACF,SAAL,EAAgB;AACZ,QAAIE,KAAJ,EAAW;AAEP,YAAM,IAAIA,KAAJ,CAAUD,GAAV,CAAN;AACH,KAHD,MAGO;AACH,YAAM,IAAIE,KAAJ,CAAUF,GAAV,CAAN;AACH;AACJ;AACJ;AASM,SAASrE,cAAT,CAAwBwE,KAAxB,EAA+BC,aAA/B,EAA8C;AACjD,MAAID,KAAK,IAAI,IAAb,EAAmB;AACf,UAAM,IAAIE,kEAAJ,CAA4BD,aAA5B,uBAAN;AACH;;AACD,SAAOD,KAAP;AACH;AAUM,SAASvE,eAAT,CAAyBuE,KAAzB,EAAgCG,MAAhC,EAAwCF,aAAxC,EAAuD;AAC1D,MAAI,EAAED,KAAK,YAAYG,MAAnB,CAAJ,EAAgC;AAC5B,UAAM,IAAIjE,sEAAJ,CAAgC+D,aAAhC,iCAAwEE,MAAM,CAAC/D,IAAP,GAAc+D,MAAM,CAAC/D,IAArB,GAA4B+D,MAApG,KAA6GH,KAAK,IAAIA,KAAK,CAAC7D,WAAf,IAA8B6D,KAAK,CAAC7D,WAAN,CAAkBC,IAAhD,iBAAmE4D,KAAK,CAAC7D,WAAN,CAAkBC,IAArF,GAA8F,EAA3M,EAAN;AACH;;AACD,SAAO4D,KAAP;AACH;AAOM,SAASI,kBAAT,CAA4BC,UAA5B,EAAwC;AAC3C,QAAM,IAAIC,SAAJ,wBAAkCD,UAAlC,2BAAN;AACH,C;;;;;;;;;;;;AC5DD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEAE,yDAAG,CAACC,6CAAD,CAAH;;;;;;;;;;;;;ACVA;AAAA;AAAA;AACA;AACA;AACA;AAIA;AAOe,2EAAwB,CAGtC,C;;;;;;;;;;;ACjBD,2D","file":"js-joda-extra.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@js-joda/core\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@js-joda/core\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"JSJodaExtra\"] = factory(require(\"@js-joda/core\"));\n\telse\n\t\troot[\"JSJodaExtra\"] = factory(root[\"JSJoda\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__js_joda_core__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/js-joda-extra.js\");\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n/* eslint-disable no-else-return */\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n intervalInit();\n}\n\ninit();\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n Interval,\n};\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.Interval = Interval;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__js_joda_core__;"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//! @version @js-joda/extra - 0.
|
|
1
|
+
//! @version @js-joda/extra - 0.7.0
|
|
2
2
|
//! @copyright (c) 2015-2016, 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
|
-
!function(t,
|
|
5
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@js-joda/core")):"function"==typeof define&&define.amd?define(["@js-joda/core"],n):"object"==typeof exports?exports.JSJodaExtra=n(require("@js-joda/core")):t.JSJodaExtra=n(t.JSJoda)}(this,function(e){return s={},o.m=r=[function(t,n){t.exports=e},function(t,n,e){"use strict";e.r(n);var f=e(0);function h(t,n){if(null==t)throw new f.NullPointerException(n+" must not be null");return t}function s(t,n,e){if(!(t instanceof n))throw new f.IllegalArgumentException(e+" must be an instance of "+(n.name?n.name:n)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}var r=function(){function c(t,n){this._start=t,this._end=n}c.of=function(t,n){return n instanceof f.Duration?c.ofInstantDuration(t,n):c.ofInstantInstant(t,n)},c.ofInstantInstant=function(t,n){if(h(t,"startInclusive"),h(n,"endExclusive"),s(t,f.Instant,"startInclusive"),s(n,f.Instant,"endExclusive"),n.isBefore(t))throw new f.DateTimeException("End instant must on or after start instant");return new c(t,n)},c.ofInstantDuration=function(t,n){if(h(t,"startInclusive"),h(n,"duration"),s(t,f.Instant,"startInclusive"),s(n,f.Duration,"duration"),n.isNegative())throw new f.DateTimeException("Duration must not be zero or negative");return new c(t,t.plus(n))},c.parse=function(t){if(h(t,"text"),"string"!=typeof t)throw new f.IllegalArgumentException("text must be a string, but is "+t.constructor.name);for(var n=0;n<t.length;n+=1)if("/"===t.charAt(n)){var e=t.charAt(0);if("P"===e||"p"===e){var r=f.Duration.parse(t.substring(0,n)),o=f.ZonedDateTime.parse(t.substring(n+1,t.length)).toInstant();return c.of(o.minus(r),o)}var s=f.ZonedDateTime.parse(t.substring(0,n)).toInstant();if(n+1<t.length){var i=t.charAt(n+1);if("P"===i||"p"===i){var a=f.Duration.parse(t.substring(n+1,t.length));return c.of(s,s.plus(a))}}var u=f.ZonedDateTime.parse(t.substring(n+1,t.length)).toInstant();return c.of(s,u)}throw new f.DateTimeParseException("Interval cannot be parsed, no forward slash found",t,0)};var t=c.prototype;return t.start=function(){return this._start},t.end=function(){return this._end},t.isEmpty=function(){return this._start.equals(this._end)},t.isUnboundedStart=function(){return this._start.equals(f.Instant.MIN)},t.isUnboundedEnd=function(){return this._end.equals(f.Instant.MAX)},t.withStart=function(t){return c.of(t,this._end)},t.withEnd=function(t){return c.of(this._start,t)},t.contains=function(t){return h(t,"instant"),s(t,f.Instant,"instant"),this._start.compareTo(t)<=0&&(t.compareTo(this._end)<0||this.isUnboundedEnd())},t.encloses=function(t){return h(t,"other"),s(t,c,"other"),this._start.compareTo(t.start())<=0&&t.end().compareTo(this._end)<=0},t.abuts=function(t){return h(t,"other"),s(t,c,"other"),!this._end.equals(t.start())!=!this._start.equals(t.end())},t.isConnected=function(t){return h(t,"other"),s(t,c,"other"),this.equals(t)||this._start.compareTo(t.end())<=0&&t.start().compareTo(this._end)<=0},t.overlaps=function(t){return h(t,"other"),s(t,c,"other"),t.equals(this)||this._start.compareTo(t.end())<0&&t.start().compareTo(this._end)<0},t.intersection=function(t){if(h(t,"other"),s(t,c,"other"),!1===this.isConnected(t))throw new f.DateTimeException("Intervals do not connect: "+this+" and "+t);var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end());if(0<=n&&e<=0)return this;if(n<=0&&0<=e)return t;var r=0<=n?this._start:t.start(),o=e<=0?this._end:t.end();return c.of(r,o)},t.union=function(t){if(h(t,"other"),s(t,c,"other"),!1===this.isConnected(t))throw new f.DateTimeException("Intervals do not connect: "+this+" and "+t);var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end());if(0<=n&&e<=0)return t;if(n<=0&&0<=e)return this;var r=0<=n?t.start():this._start,o=e<=0?t.end():this._end;return c.of(r,o)},t.span=function(t){h(t,"other"),s(t,c,"other");var n=this._start.compareTo(t.start()),e=this._end.compareTo(t.end()),r=0<=n?t.start():this._start,o=e<=0?t.end():this._end;return c.of(r,o)},t.isAfter=function(t){return t instanceof f.Instant?this.isAfterInstant(t):this.isAfterInterval(t)},t.isBefore=function(t){return t instanceof f.Instant?this.isBeforeInstant(t):this.isBeforeInterval(t)},t.isAfterInstant=function(t){return 0<this._start.compareTo(t)},t.isBeforeInstant=function(t){return this._end.compareTo(t)<=0&&this._start.compareTo(t)<0},t.isAfterInterval=function(t){return 0<=this._start.compareTo(t.end())&&!t.equals(this)},t.isBeforeInterval=function(t){return this._end.compareTo(t.start())<=0&&!t.equals(this)},t.toDuration=function(){return f.Duration.between(this._start,this._end)},t.equals=function(t){return this===t||t instanceof c&&(this._start.equals(t.start())&&this._end.equals(t.end()))},t.hashCode=function(){return this._start.hashCode()^this._end.hashCode()},t.toString=function(){return this._start.toString()+"/"+this._end.toString()},c}();var o=!1;o||(o=!0,r.ALL=r.of(f.Instant.MIN,f.Instant.MAX));e.d(n,"Interval",function(){return r}),Object(f.use)(function(){})}],o.c=s,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)o.d(e,r,function(t){return n[t]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=1);function o(t){if(s[t])return s[t].exports;var n=s[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var r,s});
|
package/package.json
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@js-joda/extra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "additional date-time classes that complement those in js-joda",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/js-joda/js-joda.git"
|
|
8
8
|
},
|
|
9
|
-
"
|
|
9
|
+
"author": "phueper",
|
|
10
|
+
"contributors": [
|
|
11
|
+
"pithu",
|
|
12
|
+
"phueper"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://js-joda.github.io/js-joda",
|
|
15
|
+
"license": "BSD-3-Clause",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/js-joda/js-joda/issues"
|
|
18
|
+
},
|
|
19
|
+
"typings": "typings/js-joda-extra.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src",
|
|
23
|
+
"typings",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
10
27
|
"main": "dist/js-joda-extra.js",
|
|
11
28
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"test": "npx mocha --timeout 5000 --require @babel/register ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js test/pluginTest_mochaOnly.js",
|
|
29
|
+
"prepublishOnly": "npm run build-dist",
|
|
30
|
+
"test": "NODE_ENV=test npx mocha --timeout 5000 --require @babel/register ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js test/pluginTest_mochaOnly.js",
|
|
14
31
|
"test-coverage": "NODE_ENV=test COVERAGE=1 npx nyc --report-dir=build/coverage --reporter=lcov --reporter html npx mocha --timeout 5000 --require @babel/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js",
|
|
15
32
|
"test-browser": "npx karma start --reporters=dots --single-run",
|
|
16
33
|
"test-saucelabs": "npx karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true",
|
|
@@ -29,17 +46,11 @@
|
|
|
29
46
|
"sourceMap": false,
|
|
30
47
|
"instrument": false
|
|
31
48
|
},
|
|
32
|
-
"author": "phueper",
|
|
33
|
-
"contributors": [
|
|
34
|
-
"pithu",
|
|
35
|
-
"phueper"
|
|
36
|
-
],
|
|
37
|
-
"license": "BSD-3-Clause",
|
|
38
49
|
"peerDependencies": {
|
|
39
50
|
"@js-joda/core": ">=1.11.0"
|
|
40
51
|
},
|
|
41
52
|
"devDependencies": {
|
|
42
|
-
"@js-joda/core": "^
|
|
53
|
+
"@js-joda/core": "^5.0.0"
|
|
43
54
|
},
|
|
44
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "03943ccba7dab0178e3a112bce8a251410f89fe7"
|
|
45
56
|
}
|
|
File without changes
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<!--
|
|
3
|
-
~ @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
4
|
-
~ @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
5
|
-
-->
|
|
6
|
-
|
|
7
|
-
<html lang="en">
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8">
|
|
10
|
-
<title>js-joda-extra Usage Example</title>
|
|
11
|
-
<script type="text/javascript" src="../node_modules/js-joda/dist/js-joda.js"></script>
|
|
12
|
-
<script type="text/javascript" src="../dist/js-joda-extra.js"></script>
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<div class="out" />
|
|
16
|
-
<script type="text/javascript">
|
|
17
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
18
|
-
function output(s) {
|
|
19
|
-
console.log(s);
|
|
20
|
-
var outDiv = document.getElementsByClassName('out')[0];
|
|
21
|
-
var p = document.createElement('p');
|
|
22
|
-
p.innerHTML = s;
|
|
23
|
-
outDiv.appendChild(p);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var startInstant = JSJoda.ZonedDateTime.of(2016, 11, 7, 0, 0, 0, 0, JSJoda.ZoneOffset.UTC).toInstant();
|
|
27
|
-
var innerInstant = startInstant.plus(1, JSJoda.ChronoUnit.DAYS);
|
|
28
|
-
var endInstant = startInstant.plus(2, JSJoda.ChronoUnit.DAYS);
|
|
29
|
-
var outerInstant = startInstant.plus(3, JSJoda.ChronoUnit.DAYS);
|
|
30
|
-
var interval = new JSJodaExtra.Interval(startInstant, endInstant);
|
|
31
|
-
output('toString:' + interval.toString());
|
|
32
|
-
output('contains inner:' + interval.contains(innerInstant));
|
|
33
|
-
output('contains outer:' + interval.contains(outerInstant));
|
|
34
|
-
}, false);
|
|
35
|
-
</script>
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
package/examples/usage_node.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper
|
|
3
|
-
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
4
|
-
*/
|
|
5
|
-
/* eslint-disable no-console, no-var */
|
|
6
|
-
var joda = require('@js-joda/core');
|
|
7
|
-
var jodaExtra = require('../dist/js-joda-extra');
|
|
8
|
-
|
|
9
|
-
var startInstant = joda.ZonedDateTime.of(2016, 11, 7, 0, 0, 0, 0, joda.ZoneOffset.UTC).toInstant();
|
|
10
|
-
var innerInstant = startInstant.plus(1, joda.ChronoUnit.DAYS);
|
|
11
|
-
var endInstant = startInstant.plus(2, joda.ChronoUnit.DAYS);
|
|
12
|
-
var outerInstant = startInstant.plus(3, joda.ChronoUnit.DAYS);
|
|
13
|
-
var interval = new jodaExtra.Interval(startInstant, endInstant);
|
|
14
|
-
console.log('toString:', interval.toString());
|
|
15
|
-
console.log('contains inner:', interval.contains(innerInstant));
|
|
16
|
-
console.log('contains outer:', interval.contains(outerInstant));
|