@softwear/latestcollectioncore 1.0.104 → 1.0.106
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/dist/articleStatus.js +26 -10
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
- package/src/articleStatus.ts +24 -8
- package/src/types.ts +4 -0
package/dist/articleStatus.js
CHANGED
|
@@ -231,21 +231,21 @@ function whichShardsToProcess(dateRange, granularity) {
|
|
|
231
231
|
};
|
|
232
232
|
const result = [];
|
|
233
233
|
if (granularity == 'year')
|
|
234
|
-
for (let year = dateRange.
|
|
234
|
+
for (let year = dateRange.utcFromYear; year <= dateRange.utcToYear; year++)
|
|
235
235
|
result.push(year);
|
|
236
236
|
else
|
|
237
|
-
for (let year = dateRange.
|
|
238
|
-
if (year == dateRange.
|
|
239
|
-
for (let month = dateRange.
|
|
237
|
+
for (let year = dateRange.utcFromYear; year <= dateRange.utcToYear; year++) {
|
|
238
|
+
if (year == dateRange.utcFromYear && year < dateRange.utcToYear)
|
|
239
|
+
for (let month = dateRange.utcFromMonth; month <= 12; month++)
|
|
240
240
|
result.push('' + year + '' + padl(month));
|
|
241
|
-
if (year == dateRange.
|
|
242
|
-
for (let month = dateRange.
|
|
241
|
+
if (year == dateRange.utcFromYear && year == dateRange.utcToYear)
|
|
242
|
+
for (let month = dateRange.utcFromMonth; month <= dateRange.utcToMonth; month++)
|
|
243
243
|
result.push('' + year + '' + padl(month));
|
|
244
|
-
if (year != dateRange.
|
|
244
|
+
if (year != dateRange.utcFromYear && year != dateRange.utcToYear)
|
|
245
245
|
for (let month = 1; month <= 12; month++)
|
|
246
246
|
result.push('' + year + '' + padl(month));
|
|
247
|
-
if (year != dateRange.
|
|
248
|
-
for (let month = 1; month <= dateRange.
|
|
247
|
+
if (year != dateRange.utcFromYear && year == dateRange.utcToYear)
|
|
248
|
+
for (let month = 1; month <= dateRange.utcToMonth; month++)
|
|
249
249
|
result.push('' + year + '' + padl(month));
|
|
250
250
|
}
|
|
251
251
|
return result;
|
|
@@ -344,6 +344,10 @@ const getDateRangeFromPicker = function (inputDates) {
|
|
|
344
344
|
beginTimeStamp: 0,
|
|
345
345
|
endTimeStamp: 0,
|
|
346
346
|
timeFrame: 0,
|
|
347
|
+
utcFromYear: 0,
|
|
348
|
+
utcToYear: 0,
|
|
349
|
+
utcFromMonth: 0,
|
|
350
|
+
utcToMonth: 0,
|
|
347
351
|
fromYear: 0,
|
|
348
352
|
toYear: 0,
|
|
349
353
|
fromMonth: 0,
|
|
@@ -368,8 +372,12 @@ const getDateRangeFromPicker = function (inputDates) {
|
|
|
368
372
|
beginTimeStamp,
|
|
369
373
|
endTimeStamp,
|
|
370
374
|
timeFrame,
|
|
375
|
+
utcFromYear: fromDate.getUTCFullYear(),
|
|
376
|
+
utcToYear: toDate.getUTCFullYear(),
|
|
377
|
+
utcFromMonth: fromDate.getUTCMonth() + 1,
|
|
378
|
+
utcToMonth: toDate.getUTCMonth() + 1,
|
|
371
379
|
fromYear: parseInt((0, date_fns_1.format)(fromDate, 'yyyy')),
|
|
372
|
-
toYear:
|
|
380
|
+
toYear: toDate.getUTCFullYear(),
|
|
373
381
|
fromMonth: parseInt((0, date_fns_1.format)(fromDate, 'MM')),
|
|
374
382
|
toMonth: parseInt((0, date_fns_1.format)(toDate, 'MM')),
|
|
375
383
|
hrYear: (0, date_fns_1.format)(fromDate, 'yyyy'),
|
|
@@ -388,6 +396,10 @@ const getDateRangeFromDatePair = function (inputDates) {
|
|
|
388
396
|
beginTimeStamp: 0,
|
|
389
397
|
endTimeStamp: 0,
|
|
390
398
|
timeFrame: 0,
|
|
399
|
+
utcFromYear: 0,
|
|
400
|
+
utcToYear: 0,
|
|
401
|
+
utcFromMonth: 0,
|
|
402
|
+
utcToMonth: 0,
|
|
391
403
|
fromYear: 0,
|
|
392
404
|
toYear: 0,
|
|
393
405
|
fromMonth: 0,
|
|
@@ -412,6 +424,10 @@ const getDateRangeFromDatePair = function (inputDates) {
|
|
|
412
424
|
beginTimeStamp,
|
|
413
425
|
endTimeStamp,
|
|
414
426
|
timeFrame,
|
|
427
|
+
utcFromYear: fromDate.getUTCFullYear(),
|
|
428
|
+
utcToYear: toDate.getUTCFullYear(),
|
|
429
|
+
utcFromMonth: fromDate.getUTCMonth(),
|
|
430
|
+
utcToMonth: toDate.getUTCMonth(),
|
|
415
431
|
fromYear: parseInt((0, date_fns_1.format)(fromDate, 'yyyy')),
|
|
416
432
|
toYear: parseInt((0, date_fns_1.format)(toDate, 'yyyy')),
|
|
417
433
|
fromMonth: parseInt((0, date_fns_1.format)(fromDate, 'MM')),
|
package/dist/types.d.ts
CHANGED
|
@@ -304,6 +304,10 @@ interface HrTimeframeI {
|
|
|
304
304
|
beginTimeStamp: number;
|
|
305
305
|
endTimeStamp: number;
|
|
306
306
|
timeFrame: number;
|
|
307
|
+
utcFromYear: number;
|
|
308
|
+
utcToYear: number;
|
|
309
|
+
utcFromMonth: number;
|
|
310
|
+
utcToMonth: number;
|
|
307
311
|
fromYear: number;
|
|
308
312
|
toYear: number;
|
|
309
313
|
fromMonth: number;
|
package/package.json
CHANGED
package/src/articleStatus.ts
CHANGED
|
@@ -304,14 +304,14 @@ function whichShardsToProcess(dateRange: any, granularity: 'year' | 'month'): an
|
|
|
304
304
|
return '0' + s
|
|
305
305
|
}
|
|
306
306
|
const result = [] as any[]
|
|
307
|
-
if (granularity == 'year') for (let year = dateRange.
|
|
307
|
+
if (granularity == 'year') for (let year = dateRange.utcFromYear; year <= dateRange.utcToYear; year++) result.push(year)
|
|
308
308
|
else
|
|
309
|
-
for (let year = dateRange.
|
|
310
|
-
if (year == dateRange.
|
|
311
|
-
if (year == dateRange.
|
|
312
|
-
for (let month = dateRange.
|
|
313
|
-
if (year != dateRange.
|
|
314
|
-
if (year != dateRange.
|
|
309
|
+
for (let year = dateRange.utcFromYear; year <= dateRange.utcToYear; year++) {
|
|
310
|
+
if (year == dateRange.utcFromYear && year < dateRange.utcToYear) for (let month = dateRange.utcFromMonth; month <= 12; month++) result.push('' + year + '' + padl(month))
|
|
311
|
+
if (year == dateRange.utcFromYear && year == dateRange.utcToYear)
|
|
312
|
+
for (let month = dateRange.utcFromMonth; month <= dateRange.utcToMonth; month++) result.push('' + year + '' + padl(month))
|
|
313
|
+
if (year != dateRange.utcFromYear && year != dateRange.utcToYear) for (let month = 1; month <= 12; month++) result.push('' + year + '' + padl(month))
|
|
314
|
+
if (year != dateRange.utcFromYear && year == dateRange.utcToYear) for (let month = 1; month <= dateRange.utcToMonth; month++) result.push('' + year + '' + padl(month))
|
|
315
315
|
}
|
|
316
316
|
return result
|
|
317
317
|
}
|
|
@@ -414,6 +414,10 @@ const getDateRangeFromPicker = function (inputDates: string[]): HrTimeframeI {
|
|
|
414
414
|
beginTimeStamp: 0,
|
|
415
415
|
endTimeStamp: 0,
|
|
416
416
|
timeFrame: 0,
|
|
417
|
+
utcFromYear: 0,
|
|
418
|
+
utcToYear: 0,
|
|
419
|
+
utcFromMonth: 0,
|
|
420
|
+
utcToMonth: 0,
|
|
417
421
|
fromYear: 0,
|
|
418
422
|
toYear: 0,
|
|
419
423
|
fromMonth: 0,
|
|
@@ -439,8 +443,12 @@ const getDateRangeFromPicker = function (inputDates: string[]): HrTimeframeI {
|
|
|
439
443
|
beginTimeStamp,
|
|
440
444
|
endTimeStamp,
|
|
441
445
|
timeFrame,
|
|
446
|
+
utcFromYear: fromDate.getUTCFullYear(),
|
|
447
|
+
utcToYear: toDate.getUTCFullYear(),
|
|
448
|
+
utcFromMonth: fromDate.getUTCMonth() + 1,
|
|
449
|
+
utcToMonth: toDate.getUTCMonth() + 1,
|
|
442
450
|
fromYear: parseInt(format(fromDate, 'yyyy')),
|
|
443
|
-
toYear:
|
|
451
|
+
toYear: toDate.getUTCFullYear(),
|
|
444
452
|
fromMonth: parseInt(format(fromDate, 'MM')),
|
|
445
453
|
toMonth: parseInt(format(toDate, 'MM')),
|
|
446
454
|
hrYear: format(fromDate, 'yyyy'),
|
|
@@ -460,6 +468,10 @@ const getDateRangeFromDatePair = function (inputDates: string[]): HrTimeframeI {
|
|
|
460
468
|
beginTimeStamp: 0,
|
|
461
469
|
endTimeStamp: 0,
|
|
462
470
|
timeFrame: 0,
|
|
471
|
+
utcFromYear: 0,
|
|
472
|
+
utcToYear: 0,
|
|
473
|
+
utcFromMonth: 0,
|
|
474
|
+
utcToMonth: 0,
|
|
463
475
|
fromYear: 0,
|
|
464
476
|
toYear: 0,
|
|
465
477
|
fromMonth: 0,
|
|
@@ -485,6 +497,10 @@ const getDateRangeFromDatePair = function (inputDates: string[]): HrTimeframeI {
|
|
|
485
497
|
beginTimeStamp,
|
|
486
498
|
endTimeStamp,
|
|
487
499
|
timeFrame,
|
|
500
|
+
utcFromYear: fromDate.getUTCFullYear(),
|
|
501
|
+
utcToYear: toDate.getUTCFullYear(),
|
|
502
|
+
utcFromMonth: fromDate.getUTCMonth(),
|
|
503
|
+
utcToMonth: toDate.getUTCMonth(),
|
|
488
504
|
fromYear: parseInt(format(fromDate, 'yyyy')),
|
|
489
505
|
toYear: parseInt(format(toDate, 'yyyy')),
|
|
490
506
|
fromMonth: parseInt(format(fromDate, 'MM')),
|
package/src/types.ts
CHANGED
|
@@ -323,6 +323,10 @@ interface HrTimeframeI {
|
|
|
323
323
|
beginTimeStamp: number
|
|
324
324
|
endTimeStamp: number
|
|
325
325
|
timeFrame: number
|
|
326
|
+
utcFromYear: number
|
|
327
|
+
utcToYear: number
|
|
328
|
+
utcFromMonth: number
|
|
329
|
+
utcToMonth: number
|
|
326
330
|
fromYear: number
|
|
327
331
|
toYear: number
|
|
328
332
|
fromMonth: number
|