@etainabl/nodejs-sdk 1.2.3 → 1.2.4
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/package.json +1 -1
- package/src/reporting.ts +10 -2
package/package.json
CHANGED
package/src/reporting.ts
CHANGED
|
@@ -48,7 +48,15 @@ export const getScheduledReportRunTimes = (schedule: any, limit = 1, taskTime =
|
|
|
48
48
|
|
|
49
49
|
let startDate = originalStartDate;
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const includeStartDate = taskTime.isSameOrBefore(originalStartDate, 'minute');
|
|
52
|
+
|
|
53
|
+
let runTimes = [] as moment.Moment[];
|
|
54
|
+
|
|
55
|
+
if (includeStartDate) {
|
|
56
|
+
runTimes = [originalStartDate];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const scheduleRunTimes = Array.from(Array(includeStartDate ? limit - 1 : limit).keys()).map(() => {
|
|
52
60
|
const nextRunTime = getNextRunTime(startDate, schedule, taskTime);
|
|
53
61
|
|
|
54
62
|
startDate = nextRunTime.hour(originalStartDate.hour()).minute(originalStartDate.minute());
|
|
@@ -56,5 +64,5 @@ export const getScheduledReportRunTimes = (schedule: any, limit = 1, taskTime =
|
|
|
56
64
|
return nextRunTime;
|
|
57
65
|
});
|
|
58
66
|
|
|
59
|
-
return runTimes;
|
|
67
|
+
return [...runTimes, ...scheduleRunTimes];
|
|
60
68
|
};
|