mol_time_all 1.1.12 → 1.1.13
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/.nojekyll +0 -0
- package/README.md +45 -0
- package/node.d.ts +151 -136
- package/node.deps.json +1 -1
- package/node.esm.js +629 -600
- package/node.esm.js.map +1 -1
- package/node.js +629 -600
- package/node.js.map +1 -1
- package/node.test.js +2192 -4345
- package/node.test.js.map +1 -1
- package/package.json +2 -3
- package/web.d.ts +151 -136
- package/web.deps.json +1 -1
- package/web.esm.js +628 -597
- package/web.esm.js.map +1 -1
- package/web.js +628 -597
- package/web.js.map +1 -1
- package/web.test.js +877 -3278
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -1,627 +1,656 @@
|
|
|
1
|
-
|
|
2
|
-
;
|
|
3
|
-
process.on( 'unhandledRejection' , up => { throw up } );
|
|
1
|
+
"use strict";
|
|
2
|
+
var exports = void 0;
|
|
4
3
|
"use strict"
|
|
5
4
|
|
|
6
5
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
6
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
7
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
10
|
};
|
|
12
11
|
|
|
13
|
-
var globalThis = globalThis || global
|
|
12
|
+
var globalThis = globalThis || ( typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this )
|
|
14
13
|
var $ = ( typeof module === 'object' ) ? Object.setPrototypeOf( module['export'+'s'] , globalThis ) : globalThis
|
|
15
14
|
$.$$ = $
|
|
16
|
-
$.$mol = $ // deprecated
|
|
17
15
|
|
|
18
16
|
;
|
|
19
17
|
|
|
20
18
|
var $node = $node || {}
|
|
21
|
-
void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../
|
|
19
|
+
void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
|
|
22
20
|
;
|
|
23
|
-
"use strict";
|
|
24
|
-
Error.stackTraceLimit =
|
|
25
|
-
var $;
|
|
26
|
-
(function ($) {
|
|
27
|
-
})($ || ($ = {}));
|
|
28
|
-
module.exports = $;
|
|
29
|
-
//
|
|
21
|
+
"use strict";
|
|
22
|
+
Error.stackTraceLimit = 50;
|
|
23
|
+
var $;
|
|
24
|
+
(function ($) {
|
|
25
|
+
})($ || ($ = {}));
|
|
26
|
+
module.exports = $;
|
|
27
|
+
//mam.js.map
|
|
30
28
|
;
|
|
31
29
|
|
|
32
|
-
$node[ "../
|
|
30
|
+
$node[ "../mam" ] = $node[ "../mam.js" ] = module.exports }.call( {} , {} )
|
|
33
31
|
;
|
|
34
|
-
"use strict";
|
|
35
|
-
var $;
|
|
36
|
-
(function ($) {
|
|
37
|
-
class $mol_time_base {
|
|
38
|
-
static
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
$.$mol_time_base = $mol_time_base;
|
|
66
|
-
})($ || ($ = {}));
|
|
32
|
+
"use strict";
|
|
33
|
+
var $;
|
|
34
|
+
(function ($) {
|
|
35
|
+
class $mol_time_base {
|
|
36
|
+
static patterns = {};
|
|
37
|
+
static formatter(pattern) {
|
|
38
|
+
if (this.patterns[pattern])
|
|
39
|
+
return this.patterns[pattern];
|
|
40
|
+
var tokens = Object.keys(this.patterns)
|
|
41
|
+
.sort()
|
|
42
|
+
.reverse()
|
|
43
|
+
.map((token) => token.replace(/([-+*.\[\]()\^])/g, '\\$1'));
|
|
44
|
+
var lexer = RegExp('(.*?)(' + tokens.join('|') + '|$)', 'g');
|
|
45
|
+
var funcs = [];
|
|
46
|
+
pattern.replace(lexer, (str, text, token) => {
|
|
47
|
+
if (text)
|
|
48
|
+
funcs.push(() => text);
|
|
49
|
+
if (token)
|
|
50
|
+
funcs.push(this.patterns[token]);
|
|
51
|
+
return str;
|
|
52
|
+
});
|
|
53
|
+
return this.patterns[pattern] = (arg) => {
|
|
54
|
+
return funcs.reduce((res, func) => res + func(arg), '');
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
toString(pattern) {
|
|
58
|
+
const Base = this.constructor;
|
|
59
|
+
const formatter = Base.formatter(pattern);
|
|
60
|
+
return formatter(this);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
$.$mol_time_base = $mol_time_base;
|
|
64
|
+
})($ || ($ = {}));
|
|
67
65
|
//base.js.map
|
|
68
66
|
;
|
|
69
|
-
"use strict";
|
|
70
|
-
var $;
|
|
71
|
-
(function ($) {
|
|
72
|
-
class $mol_time_duration extends $.$mol_time_base {
|
|
73
|
-
constructor(config = 0) {
|
|
74
|
-
super();
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
if (found[
|
|
97
|
-
this.
|
|
98
|
-
if (found[
|
|
99
|
-
this.
|
|
100
|
-
if (found[
|
|
101
|
-
this.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
summ(config) {
|
|
131
|
-
const duration = new $mol_time_duration(config);
|
|
132
|
-
return new $mol_time_duration({
|
|
133
|
-
year: this.year + duration.year,
|
|
134
|
-
month: this.month + duration.month,
|
|
135
|
-
day: this.day + duration.day,
|
|
136
|
-
hour: this.hour + duration.hour,
|
|
137
|
-
minute: this.minute + duration.minute,
|
|
138
|
-
second: this.second + duration.second,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
mult(numb) {
|
|
142
|
-
return new $mol_time_duration({
|
|
143
|
-
year: this.year && this.year * numb,
|
|
144
|
-
month: this.month && this.month * numb,
|
|
145
|
-
day: this.day && this.day * numb,
|
|
146
|
-
hour: this.hour && this.hour * numb,
|
|
147
|
-
minute: this.minute && this.minute * numb,
|
|
148
|
-
second: this.second && this.second * numb,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
count(config) {
|
|
152
|
-
const duration = new $mol_time_duration(config);
|
|
153
|
-
return this.valueOf() / duration.valueOf();
|
|
154
|
-
}
|
|
155
|
-
valueOf() {
|
|
156
|
-
var day = this.year * 365 + this.month * 30.4 + this.day;
|
|
157
|
-
var second = ((day * 24 + this.hour) * 60 + this.minute) * 60 + this.second;
|
|
158
|
-
return second * 1000;
|
|
159
|
-
}
|
|
160
|
-
toJSON() { return this.toString(); }
|
|
161
|
-
toString(pattern = 'P#Y#M#DT#h#m#s') {
|
|
162
|
-
return super.toString(pattern);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return '';
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return '';
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return '';
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return '';
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return '';
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return '';
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
$.$mol_time_duration = $mol_time_duration;
|
|
198
|
-
})($ || ($ = {}));
|
|
67
|
+
"use strict";
|
|
68
|
+
var $;
|
|
69
|
+
(function ($) {
|
|
70
|
+
class $mol_time_duration extends $.$mol_time_base {
|
|
71
|
+
constructor(config = 0) {
|
|
72
|
+
super();
|
|
73
|
+
if (typeof config === 'number') {
|
|
74
|
+
this.second = config / 1000;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (typeof config === 'string') {
|
|
78
|
+
if (config === 'Z') {
|
|
79
|
+
this.hour = 0;
|
|
80
|
+
this.minute = 0;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
duration: {
|
|
84
|
+
const parser = /^P(?:([+-]?\d+(?:\.\d+)?)Y)?(?:([+-]?\d+(?:\.\d+)?)M)?(?:([+-]?\d+(?:\.\d+)?)D)?(?:T(?:([+-]?\d+(?:\.\d+)?)h)?(?:([+-]?\d+(?:\.\d+)?)m)?(?:([+-]?\d+(?:\.\d+)?)s)?)?$/i;
|
|
85
|
+
const found = parser.exec(config);
|
|
86
|
+
if (!found)
|
|
87
|
+
break duration;
|
|
88
|
+
if (found[1])
|
|
89
|
+
this.year = Number(found[1]);
|
|
90
|
+
if (found[2])
|
|
91
|
+
this.month = Number(found[2]);
|
|
92
|
+
if (found[3])
|
|
93
|
+
this.day = Number(found[3]);
|
|
94
|
+
if (found[4])
|
|
95
|
+
this.hour = Number(found[4]);
|
|
96
|
+
if (found[5])
|
|
97
|
+
this.minute = Number(found[5]);
|
|
98
|
+
if (found[6])
|
|
99
|
+
this.second = Number(found[6]);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
offset: {
|
|
103
|
+
var parser = /^[+-](\d\d)(?::?(\d\d))?$/i;
|
|
104
|
+
var found = parser.exec(config);
|
|
105
|
+
if (!found)
|
|
106
|
+
break offset;
|
|
107
|
+
if (found[1])
|
|
108
|
+
this.hour = Number(found[1]);
|
|
109
|
+
if (found[2])
|
|
110
|
+
this.minute = Number(found[2]);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
throw new Error(`Can not parse time duration (${config})`);
|
|
114
|
+
}
|
|
115
|
+
this.year = config.year || 0;
|
|
116
|
+
this.month = config.month || 0;
|
|
117
|
+
this.day = config.day || 0;
|
|
118
|
+
this.hour = config.hour || 0;
|
|
119
|
+
this.minute = config.minute || 0;
|
|
120
|
+
this.second = config.second || 0;
|
|
121
|
+
}
|
|
122
|
+
year = 0;
|
|
123
|
+
month = 0;
|
|
124
|
+
day = 0;
|
|
125
|
+
hour = 0;
|
|
126
|
+
minute = 0;
|
|
127
|
+
second = 0;
|
|
128
|
+
summ(config) {
|
|
129
|
+
const duration = new $mol_time_duration(config);
|
|
130
|
+
return new $mol_time_duration({
|
|
131
|
+
year: this.year + duration.year,
|
|
132
|
+
month: this.month + duration.month,
|
|
133
|
+
day: this.day + duration.day,
|
|
134
|
+
hour: this.hour + duration.hour,
|
|
135
|
+
minute: this.minute + duration.minute,
|
|
136
|
+
second: this.second + duration.second,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
mult(numb) {
|
|
140
|
+
return new $mol_time_duration({
|
|
141
|
+
year: this.year && this.year * numb,
|
|
142
|
+
month: this.month && this.month * numb,
|
|
143
|
+
day: this.day && this.day * numb,
|
|
144
|
+
hour: this.hour && this.hour * numb,
|
|
145
|
+
minute: this.minute && this.minute * numb,
|
|
146
|
+
second: this.second && this.second * numb,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
count(config) {
|
|
150
|
+
const duration = new $mol_time_duration(config);
|
|
151
|
+
return this.valueOf() / duration.valueOf();
|
|
152
|
+
}
|
|
153
|
+
valueOf() {
|
|
154
|
+
var day = this.year * 365 + this.month * 30.4 + this.day;
|
|
155
|
+
var second = ((day * 24 + this.hour) * 60 + this.minute) * 60 + this.second;
|
|
156
|
+
return second * 1000;
|
|
157
|
+
}
|
|
158
|
+
toJSON() { return this.toString(); }
|
|
159
|
+
toString(pattern = 'P#Y#M#DT#h#m#s') {
|
|
160
|
+
return super.toString(pattern);
|
|
161
|
+
}
|
|
162
|
+
static patterns = {
|
|
163
|
+
'#Y': (duration) => {
|
|
164
|
+
if (!duration.year)
|
|
165
|
+
return '';
|
|
166
|
+
return duration.year + 'Y';
|
|
167
|
+
},
|
|
168
|
+
'#M': (duration) => {
|
|
169
|
+
if (!duration.month)
|
|
170
|
+
return '';
|
|
171
|
+
return duration.month + 'M';
|
|
172
|
+
},
|
|
173
|
+
'#D': (duration) => {
|
|
174
|
+
if (!duration.day)
|
|
175
|
+
return '';
|
|
176
|
+
return duration.day + 'D';
|
|
177
|
+
},
|
|
178
|
+
'#h': (duration) => {
|
|
179
|
+
if (!duration.hour)
|
|
180
|
+
return '';
|
|
181
|
+
return duration.hour + 'H';
|
|
182
|
+
},
|
|
183
|
+
'#m': (duration) => {
|
|
184
|
+
if (!duration.minute)
|
|
185
|
+
return '';
|
|
186
|
+
return duration.minute + 'M';
|
|
187
|
+
},
|
|
188
|
+
'#s': (duration) => {
|
|
189
|
+
if (!duration.second)
|
|
190
|
+
return '';
|
|
191
|
+
return duration.second + 'S';
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
$.$mol_time_duration = $mol_time_duration;
|
|
196
|
+
})($ || ($ = {}));
|
|
199
197
|
//duration.js.map
|
|
200
198
|
;
|
|
201
|
-
"use strict";
|
|
202
|
-
var $;
|
|
203
|
-
(function ($) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if (moment.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (moment.
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
return '';
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
return
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
return
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
199
|
+
"use strict";
|
|
200
|
+
var $;
|
|
201
|
+
(function ($) {
|
|
202
|
+
function $mol_fail(error) {
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
$.$mol_fail = $mol_fail;
|
|
206
|
+
})($ || ($ = {}));
|
|
207
|
+
//fail.js.map
|
|
208
|
+
;
|
|
209
|
+
"use strict";
|
|
210
|
+
var $;
|
|
211
|
+
(function ($) {
|
|
212
|
+
let $mol_time_moment_weekdays;
|
|
213
|
+
(function ($mol_time_moment_weekdays) {
|
|
214
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["monday"] = 0] = "monday";
|
|
215
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["tuesday"] = 1] = "tuesday";
|
|
216
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["wednesday"] = 2] = "wednesday";
|
|
217
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["thursday"] = 3] = "thursday";
|
|
218
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["friday"] = 4] = "friday";
|
|
219
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["saturday"] = 5] = "saturday";
|
|
220
|
+
$mol_time_moment_weekdays[$mol_time_moment_weekdays["sunday"] = 6] = "sunday";
|
|
221
|
+
})($mol_time_moment_weekdays = $.$mol_time_moment_weekdays || ($.$mol_time_moment_weekdays = {}));
|
|
222
|
+
function numb(str, max) {
|
|
223
|
+
const numb = Number(str);
|
|
224
|
+
if (numb < max)
|
|
225
|
+
return numb;
|
|
226
|
+
$.$mol_fail(new Error(`Wrong time component ${str}`));
|
|
227
|
+
}
|
|
228
|
+
class $mol_time_moment extends $.$mol_time_base {
|
|
229
|
+
constructor(config = new Date) {
|
|
230
|
+
super();
|
|
231
|
+
if (typeof config === 'number')
|
|
232
|
+
config = new Date(config);
|
|
233
|
+
if (typeof config === 'string') {
|
|
234
|
+
const parsed = /^(?:(\d\d?\d?\d?)(?:-?(\d\d?)(?:-?(\d\d?))?)?)?(?:[T ](?:(\d\d?)(?::?(\d\d?)(?::?(\d\d?(?:\.\d+)?))?)?)?(Z|[\+\-]\d\d?(?::?(?:\d\d?)?)?)?)?$/.exec(config);
|
|
235
|
+
if (!parsed)
|
|
236
|
+
throw new Error(`Can not parse time moment (${config})`);
|
|
237
|
+
if (parsed[1])
|
|
238
|
+
this.year = numb(parsed[1], 9999);
|
|
239
|
+
if (parsed[2])
|
|
240
|
+
this.month = numb(parsed[2], 13) - 1;
|
|
241
|
+
if (parsed[3])
|
|
242
|
+
this.day = numb(parsed[3], 32) - 1;
|
|
243
|
+
if (parsed[4])
|
|
244
|
+
this.hour = numb(parsed[4], 60);
|
|
245
|
+
if (parsed[5])
|
|
246
|
+
this.minute = numb(parsed[5], 60);
|
|
247
|
+
if (parsed[6])
|
|
248
|
+
this.second = numb(parsed[6], 60);
|
|
249
|
+
if (parsed[7])
|
|
250
|
+
this.offset = new $.$mol_time_duration(parsed[7]);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (config instanceof Date) {
|
|
254
|
+
this.year = config.getFullYear();
|
|
255
|
+
this.month = config.getMonth();
|
|
256
|
+
this.day = config.getDate() - 1;
|
|
257
|
+
this.hour = config.getHours();
|
|
258
|
+
this.minute = config.getMinutes();
|
|
259
|
+
this.second = config.getSeconds() + config.getMilliseconds() / 1000;
|
|
260
|
+
const offset = -config.getTimezoneOffset();
|
|
261
|
+
this.offset = new $.$mol_time_duration({
|
|
262
|
+
hour: (offset < 0) ? Math.ceil(offset / 60) : Math.floor(offset / 60),
|
|
263
|
+
minute: offset % 60
|
|
264
|
+
});
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
this.year = config.year;
|
|
268
|
+
this.month = config.month;
|
|
269
|
+
this.day = config.day;
|
|
270
|
+
this.hour = config.hour;
|
|
271
|
+
this.minute = config.minute;
|
|
272
|
+
this.second = config.second;
|
|
273
|
+
this.offset = config.offset == null ? config.offset : new $.$mol_time_duration(config.offset);
|
|
274
|
+
}
|
|
275
|
+
year;
|
|
276
|
+
month;
|
|
277
|
+
day;
|
|
278
|
+
hour;
|
|
279
|
+
minute;
|
|
280
|
+
second;
|
|
281
|
+
offset;
|
|
282
|
+
get weekday() {
|
|
283
|
+
return (this.native.getDay() + 6) % 7;
|
|
284
|
+
}
|
|
285
|
+
_native;
|
|
286
|
+
get native() {
|
|
287
|
+
if (this._native)
|
|
288
|
+
return this._native;
|
|
289
|
+
const utc = this.toOffset('Z');
|
|
290
|
+
return this._native = new Date(Date.UTC(utc.year ?? 0, utc.month ?? 0, (utc.day ?? 0) + 1, utc.hour ?? 0, utc.minute ?? 0, utc.second != undefined ? Math.floor(utc.second) : 0, utc.second != undefined ? Math.floor((utc.second - Math.floor(utc.second)) * 1000) : 0));
|
|
291
|
+
}
|
|
292
|
+
_normal;
|
|
293
|
+
get normal() {
|
|
294
|
+
if (this._normal)
|
|
295
|
+
return this._normal;
|
|
296
|
+
const moment = new $mol_time_moment(this.native);
|
|
297
|
+
return this._normal = new $mol_time_moment({
|
|
298
|
+
year: this.year === undefined ? undefined : moment.year,
|
|
299
|
+
month: this.month === undefined ? undefined : moment.month,
|
|
300
|
+
day: this.day === undefined ? undefined : moment.day,
|
|
301
|
+
hour: this.hour === undefined ? undefined : moment.hour,
|
|
302
|
+
minute: this.minute === undefined ? undefined : moment.minute,
|
|
303
|
+
second: this.second === undefined ? undefined : moment.second,
|
|
304
|
+
offset: this.offset === undefined ? undefined : moment.offset,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
merge(config) {
|
|
308
|
+
const moment = new $mol_time_moment(config);
|
|
309
|
+
return new $mol_time_moment({
|
|
310
|
+
year: moment.year === undefined ? this.year : moment.year,
|
|
311
|
+
month: moment.month === undefined ? this.month : moment.month,
|
|
312
|
+
day: moment.day === undefined ? this.day : moment.day,
|
|
313
|
+
hour: moment.hour === undefined ? this.hour : moment.hour,
|
|
314
|
+
minute: moment.minute === undefined ? this.minute : moment.minute,
|
|
315
|
+
second: moment.second === undefined ? this.second : moment.second,
|
|
316
|
+
offset: moment.offset === undefined ? this.offset : moment.offset,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
shift(config) {
|
|
320
|
+
const duration = new $.$mol_time_duration(config);
|
|
321
|
+
const moment = new $mol_time_moment().merge({
|
|
322
|
+
year: this.year,
|
|
323
|
+
month: this.month,
|
|
324
|
+
day: this.day,
|
|
325
|
+
hour: this.hour ?? 0,
|
|
326
|
+
minute: this.minute ?? 0,
|
|
327
|
+
second: this.second ?? 0,
|
|
328
|
+
offset: this.offset ?? 0
|
|
329
|
+
});
|
|
330
|
+
const second = moment.second + (duration.second ?? 0);
|
|
331
|
+
const native = new Date(moment.year + (duration.year ?? 0), moment.month + (duration.month ?? 0), moment.day + 1 + (duration.day ?? 0), moment.hour + (duration.hour ?? 0), moment.minute + (duration.minute ?? 0), Math.floor(second), (second - Math.floor(second)) * 1000);
|
|
332
|
+
if (isNaN(native.valueOf()))
|
|
333
|
+
throw new Error('Wrong time');
|
|
334
|
+
return new $mol_time_moment({
|
|
335
|
+
year: this.year === undefined ? undefined : native.getFullYear(),
|
|
336
|
+
month: this.month === undefined ? undefined : native.getMonth(),
|
|
337
|
+
day: this.day === undefined ? undefined : native.getDate() - 1,
|
|
338
|
+
hour: this.hour === undefined ? undefined : native.getHours(),
|
|
339
|
+
minute: this.minute === undefined ? undefined : native.getMinutes(),
|
|
340
|
+
second: this.second === undefined ? undefined : native.getSeconds() + native.getMilliseconds() / 1000,
|
|
341
|
+
offset: this.offset,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
mask(config) {
|
|
345
|
+
const mask = new $mol_time_moment(config);
|
|
346
|
+
return new $mol_time_moment({
|
|
347
|
+
year: mask.year === undefined ? undefined : this.year,
|
|
348
|
+
month: mask.month === undefined ? undefined : this.month,
|
|
349
|
+
day: mask.day === undefined ? undefined : this.day,
|
|
350
|
+
hour: mask.hour === undefined ? undefined : this.hour,
|
|
351
|
+
minute: mask.minute === undefined ? undefined : this.minute,
|
|
352
|
+
second: mask.second === undefined ? undefined : this.second,
|
|
353
|
+
offset: mask.offset === undefined ? undefined : this.offset,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
toOffset(config) {
|
|
357
|
+
const duration = new $.$mol_time_duration(config);
|
|
358
|
+
const offset = this.offset || new $mol_time_moment().offset;
|
|
359
|
+
let with_time = new $mol_time_moment('T00:00:00').merge(this);
|
|
360
|
+
const moment = with_time.shift(duration.summ(offset.mult(-1)));
|
|
361
|
+
return moment.merge({ offset: duration });
|
|
362
|
+
}
|
|
363
|
+
valueOf() { return this.native.getTime(); }
|
|
364
|
+
toJSON() { return this.toString(); }
|
|
365
|
+
toString(pattern = 'YYYY-MM-DDThh:mm:ss.sssZ') {
|
|
366
|
+
return super.toString(pattern);
|
|
367
|
+
}
|
|
368
|
+
static patterns = {
|
|
369
|
+
'YYYY': (moment) => {
|
|
370
|
+
if (moment.year == null)
|
|
371
|
+
return '';
|
|
372
|
+
return String(moment.year);
|
|
373
|
+
},
|
|
374
|
+
'AD': (moment) => {
|
|
375
|
+
if (moment.year == null)
|
|
376
|
+
return '';
|
|
377
|
+
return String(Math.floor(moment.year / 100) + 1);
|
|
378
|
+
},
|
|
379
|
+
'YY': (moment) => {
|
|
380
|
+
if (moment.year == null)
|
|
381
|
+
return '';
|
|
382
|
+
return String(moment.year % 100);
|
|
383
|
+
},
|
|
384
|
+
'Month': (pattern => (moment) => {
|
|
385
|
+
if (moment.month == null)
|
|
386
|
+
return '';
|
|
387
|
+
return pattern.format(moment.native);
|
|
388
|
+
})(new Intl.DateTimeFormat(undefined, { month: 'long' })),
|
|
389
|
+
'DD Month': (pattern => (moment) => {
|
|
390
|
+
if (moment.month == null) {
|
|
391
|
+
if (moment.day == null) {
|
|
392
|
+
return '';
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
return $mol_time_moment.patterns['DD'](moment);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
if (moment.day == null) {
|
|
400
|
+
return $mol_time_moment.patterns['Month'](moment);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
return pattern.format(moment.native);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
})(new Intl.DateTimeFormat(undefined, { day: '2-digit', month: 'long' })),
|
|
407
|
+
'D Month': (pattern => (moment) => {
|
|
408
|
+
if (moment.month == null) {
|
|
409
|
+
if (moment.day == null) {
|
|
410
|
+
return '';
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
return $mol_time_moment.patterns['D'](moment);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
if (moment.day == null) {
|
|
418
|
+
return $mol_time_moment.patterns['Month'](moment);
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
return pattern.format(moment.native);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
})(new Intl.DateTimeFormat(undefined, { day: 'numeric', month: 'long' })),
|
|
425
|
+
'Mon': (pattern => (moment) => {
|
|
426
|
+
if (moment.month == null)
|
|
427
|
+
return '';
|
|
428
|
+
return pattern.format(moment.native);
|
|
429
|
+
})(new Intl.DateTimeFormat(undefined, { month: 'short' })),
|
|
430
|
+
'DD Mon': (pattern => (moment) => {
|
|
431
|
+
if (moment.month == null) {
|
|
432
|
+
if (moment.day == null) {
|
|
433
|
+
return '';
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
return $mol_time_moment.patterns['DD'](moment);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
if (moment.day == null) {
|
|
441
|
+
return $mol_time_moment.patterns['Mon'](moment);
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
return pattern.format(moment.native);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
})(new Intl.DateTimeFormat(undefined, { day: '2-digit', month: 'short' })),
|
|
448
|
+
'D Mon': (pattern => (moment) => {
|
|
449
|
+
if (moment.month == null) {
|
|
450
|
+
if (moment.day == null) {
|
|
451
|
+
return '';
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
return $mol_time_moment.patterns['D'](moment);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
if (moment.day == null) {
|
|
459
|
+
return $mol_time_moment.patterns['Mon'](moment);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
return pattern.format(moment.native);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
})(new Intl.DateTimeFormat(undefined, { day: 'numeric', month: 'short' })),
|
|
466
|
+
'-MM': (moment) => {
|
|
467
|
+
if (moment.month == null)
|
|
468
|
+
return '';
|
|
469
|
+
return '-' + $mol_time_moment.patterns['MM'](moment);
|
|
470
|
+
},
|
|
471
|
+
'MM': (moment) => {
|
|
472
|
+
if (moment.month == null)
|
|
473
|
+
return '';
|
|
474
|
+
return String(100 + moment.month + 1).slice(1);
|
|
475
|
+
},
|
|
476
|
+
'M': (moment) => {
|
|
477
|
+
if (moment.month == null)
|
|
478
|
+
return '';
|
|
479
|
+
return String(moment.month + 1);
|
|
480
|
+
},
|
|
481
|
+
'WeekDay': (pattern => (moment) => {
|
|
482
|
+
if (moment.day == null)
|
|
483
|
+
return '';
|
|
484
|
+
if (moment.month == null)
|
|
485
|
+
return '';
|
|
486
|
+
if (moment.year == null)
|
|
487
|
+
return '';
|
|
488
|
+
return pattern.format(moment.native);
|
|
489
|
+
})(new Intl.DateTimeFormat(undefined, { weekday: 'long' })),
|
|
490
|
+
'WD': (pattern => (moment) => {
|
|
491
|
+
if (moment.day == null)
|
|
492
|
+
return '';
|
|
493
|
+
if (moment.month == null)
|
|
494
|
+
return '';
|
|
495
|
+
if (moment.year == null)
|
|
496
|
+
return '';
|
|
497
|
+
return pattern.format(moment.native);
|
|
498
|
+
})(new Intl.DateTimeFormat(undefined, { weekday: 'short' })),
|
|
499
|
+
'-DD': (moment) => {
|
|
500
|
+
if (moment.day == null)
|
|
501
|
+
return '';
|
|
502
|
+
return '-' + $mol_time_moment.patterns['DD'](moment);
|
|
503
|
+
},
|
|
504
|
+
'DD': (moment) => {
|
|
505
|
+
if (moment.day == null)
|
|
506
|
+
return '';
|
|
507
|
+
return String(100 + moment.day + 1).slice(1);
|
|
508
|
+
},
|
|
509
|
+
'D': (moment) => {
|
|
510
|
+
if (moment.day == null)
|
|
511
|
+
return '';
|
|
512
|
+
return String(moment.day + 1);
|
|
513
|
+
},
|
|
514
|
+
'Thh': (moment) => {
|
|
515
|
+
if (moment.hour == null)
|
|
516
|
+
return '';
|
|
517
|
+
return 'T' + $mol_time_moment.patterns['hh'](moment);
|
|
518
|
+
},
|
|
519
|
+
'hh': (moment) => {
|
|
520
|
+
if (moment.hour == null)
|
|
521
|
+
return '';
|
|
522
|
+
return String(100 + moment.hour).slice(1);
|
|
523
|
+
},
|
|
524
|
+
'h': (moment) => {
|
|
525
|
+
if (moment.hour == null)
|
|
526
|
+
return '';
|
|
527
|
+
return String(moment.hour);
|
|
528
|
+
},
|
|
529
|
+
':mm': (moment) => {
|
|
530
|
+
if (moment.minute == null)
|
|
531
|
+
return '';
|
|
532
|
+
return ':' + $mol_time_moment.patterns['mm'](moment);
|
|
533
|
+
},
|
|
534
|
+
'mm': (moment) => {
|
|
535
|
+
if (moment.minute == null)
|
|
536
|
+
return '';
|
|
537
|
+
return String(100 + moment.minute).slice(1);
|
|
538
|
+
},
|
|
539
|
+
'm': (moment) => {
|
|
540
|
+
if (moment.minute == null)
|
|
541
|
+
return '';
|
|
542
|
+
return String(moment.minute);
|
|
543
|
+
},
|
|
544
|
+
':ss': (moment) => {
|
|
545
|
+
if (moment.second == null)
|
|
546
|
+
return '';
|
|
547
|
+
return ':' + $mol_time_moment.patterns['ss'](moment);
|
|
548
|
+
},
|
|
549
|
+
'ss': (moment) => {
|
|
550
|
+
if (moment.second == null)
|
|
551
|
+
return '';
|
|
552
|
+
return String(100 + moment.second | 0).slice(1);
|
|
553
|
+
},
|
|
554
|
+
's': (moment) => {
|
|
555
|
+
if (moment.second == null)
|
|
556
|
+
return '';
|
|
557
|
+
return String(moment.second | 0);
|
|
558
|
+
},
|
|
559
|
+
'.sss': (moment) => {
|
|
560
|
+
if (moment.second == null)
|
|
561
|
+
return '';
|
|
562
|
+
if (moment.second === (moment.second | 0))
|
|
563
|
+
return '';
|
|
564
|
+
return '.' + $mol_time_moment.patterns['sss'](moment);
|
|
565
|
+
},
|
|
566
|
+
'sss': (moment) => {
|
|
567
|
+
if (moment.second == null)
|
|
568
|
+
return '';
|
|
569
|
+
const millisecond = Math.floor((moment.second - Math.floor(moment.second)) * 1000);
|
|
570
|
+
return String(1000 + millisecond).slice(1);
|
|
571
|
+
},
|
|
572
|
+
'Z': (moment) => {
|
|
573
|
+
const offset = moment.offset;
|
|
574
|
+
if (!offset)
|
|
575
|
+
return '';
|
|
576
|
+
let hour = offset.hour;
|
|
577
|
+
let sign = '+';
|
|
578
|
+
if (hour < 0) {
|
|
579
|
+
sign = '-';
|
|
580
|
+
hour = -hour;
|
|
581
|
+
}
|
|
582
|
+
return sign + String(100 + hour).slice(1) + ':' + String(100 + offset.minute).slice(1);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
$.$mol_time_moment = $mol_time_moment;
|
|
587
|
+
})($ || ($ = {}));
|
|
562
588
|
//moment.js.map
|
|
563
589
|
;
|
|
564
|
-
"use strict";
|
|
565
|
-
var $;
|
|
566
|
-
(function ($) {
|
|
567
|
-
class $mol_time_interval extends $.$mol_time_base {
|
|
568
|
-
constructor(config) {
|
|
569
|
-
super();
|
|
570
|
-
if (typeof config === 'string') {
|
|
571
|
-
var chunks = config.split('/');
|
|
572
|
-
if (chunks[0]) {
|
|
573
|
-
if (chunks[0][0].toUpperCase() === 'P') {
|
|
574
|
-
this._duration = new $.$mol_time_duration(chunks[0]);
|
|
575
|
-
}
|
|
576
|
-
else {
|
|
577
|
-
this._start = new $.$mol_time_moment(chunks[0]);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
else {
|
|
581
|
-
this._start = new $.$mol_time_moment();
|
|
582
|
-
}
|
|
583
|
-
if (chunks[1]) {
|
|
584
|
-
if (chunks[1][0].toUpperCase() === 'P') {
|
|
585
|
-
this._duration = new $.$mol_time_duration(chunks[1]);
|
|
586
|
-
}
|
|
587
|
-
else {
|
|
588
|
-
this._end = new $.$mol_time_moment(chunks[1]);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
this._end = new $.$mol_time_moment();
|
|
593
|
-
}
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
if (config.start !== undefined)
|
|
597
|
-
this._start = new $.$mol_time_moment(config.start);
|
|
598
|
-
if (config.end !== undefined)
|
|
599
|
-
this._end = new $.$mol_time_moment(config.end);
|
|
600
|
-
if (config.duration !== undefined)
|
|
601
|
-
this._duration = new $.$mol_time_duration(config.duration);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
}
|
|
590
|
+
"use strict";
|
|
591
|
+
var $;
|
|
592
|
+
(function ($) {
|
|
593
|
+
class $mol_time_interval extends $.$mol_time_base {
|
|
594
|
+
constructor(config) {
|
|
595
|
+
super();
|
|
596
|
+
if (typeof config === 'string') {
|
|
597
|
+
var chunks = config.split('/');
|
|
598
|
+
if (chunks[0]) {
|
|
599
|
+
if (chunks[0][0].toUpperCase() === 'P') {
|
|
600
|
+
this._duration = new $.$mol_time_duration(chunks[0]);
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
this._start = new $.$mol_time_moment(chunks[0]);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
this._start = new $.$mol_time_moment();
|
|
608
|
+
}
|
|
609
|
+
if (chunks[1]) {
|
|
610
|
+
if (chunks[1][0].toUpperCase() === 'P') {
|
|
611
|
+
this._duration = new $.$mol_time_duration(chunks[1]);
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
this._end = new $.$mol_time_moment(chunks[1]);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
this._end = new $.$mol_time_moment();
|
|
619
|
+
}
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
if (config.start !== undefined)
|
|
623
|
+
this._start = new $.$mol_time_moment(config.start);
|
|
624
|
+
if (config.end !== undefined)
|
|
625
|
+
this._end = new $.$mol_time_moment(config.end);
|
|
626
|
+
if (config.duration !== undefined)
|
|
627
|
+
this._duration = new $.$mol_time_duration(config.duration);
|
|
628
|
+
}
|
|
629
|
+
_start;
|
|
630
|
+
get start() {
|
|
631
|
+
if (this._start)
|
|
632
|
+
return this._start;
|
|
633
|
+
return this._start = this._end.shift(this._duration.mult(-1));
|
|
634
|
+
}
|
|
635
|
+
_end;
|
|
636
|
+
get end() {
|
|
637
|
+
if (this._end)
|
|
638
|
+
return this._end;
|
|
639
|
+
return this._end = this._start.shift(this._duration);
|
|
640
|
+
}
|
|
641
|
+
_duration;
|
|
642
|
+
get duration() {
|
|
643
|
+
if (this._duration)
|
|
644
|
+
return this._duration;
|
|
645
|
+
return this._duration = new $.$mol_time_duration(this._end.valueOf() - this._start.valueOf());
|
|
646
|
+
}
|
|
647
|
+
toJSON() { return this.toString(); }
|
|
648
|
+
toString() {
|
|
649
|
+
return (this._start || this._duration || '').toString() + '/' + (this._end || this._duration || '').toString();
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
$.$mol_time_interval = $mol_time_interval;
|
|
653
|
+
})($ || ($ = {}));
|
|
625
654
|
//interval.js.map
|
|
626
655
|
|
|
627
656
|
//# sourceMappingURL=node.js.map
|