@etainabl/nodejs-sdk 1.2.4 → 1.2.5
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/mjs/reporting.js +7 -2
- package/package.json +1 -1
package/dist/mjs/reporting.js
CHANGED
|
@@ -42,10 +42,15 @@ export const getScheduledReportRunTimes = (schedule, limit = 1, taskTime = momen
|
|
|
42
42
|
return [];
|
|
43
43
|
const originalStartDate = moment.utc(schedule.startDate);
|
|
44
44
|
let startDate = originalStartDate;
|
|
45
|
-
const
|
|
45
|
+
const includeStartDate = taskTime.isSameOrBefore(originalStartDate, 'minute');
|
|
46
|
+
let runTimes = [];
|
|
47
|
+
if (includeStartDate) {
|
|
48
|
+
runTimes = [originalStartDate];
|
|
49
|
+
}
|
|
50
|
+
const scheduleRunTimes = Array.from(Array(includeStartDate ? limit - 1 : limit).keys()).map(() => {
|
|
46
51
|
const nextRunTime = getNextRunTime(startDate, schedule, taskTime);
|
|
47
52
|
startDate = nextRunTime.hour(originalStartDate.hour()).minute(originalStartDate.minute());
|
|
48
53
|
return nextRunTime;
|
|
49
54
|
});
|
|
50
|
-
return runTimes;
|
|
55
|
+
return [...runTimes, ...scheduleRunTimes];
|
|
51
56
|
};
|