make-mp-data 1.1.16 → 1.1.17
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/index.js +2 -2
- package/package.json +1 -1
- package/tests/unit.test.js +1 -1
package/index.js
CHANGED
|
@@ -518,8 +518,8 @@ function AKsTimeSoup(earliestTime, latestTime = NOW, peakDays = PEAK_DAYS) {
|
|
|
518
518
|
// usually, ensure the event time is within business hours
|
|
519
519
|
if (chance.bool({ likelihood: 42 })) eventTime = Math.min(Math.max(eventTime, businessStart), businessEnd);
|
|
520
520
|
|
|
521
|
-
|
|
522
|
-
|
|
521
|
+
if (eventTime > 0) validTime = true;
|
|
522
|
+
|
|
523
523
|
}
|
|
524
524
|
chosenTime = dayjs.unix(eventTime).toISOString();
|
|
525
525
|
return chosenTime;
|
package/package.json
CHANGED
package/tests/unit.test.js
CHANGED
|
@@ -10,7 +10,7 @@ require('dotenv').config();
|
|
|
10
10
|
describe('timeSoup', () => {
|
|
11
11
|
test('always positive dates', () => {
|
|
12
12
|
const dates = [];
|
|
13
|
-
for (let i = 0; i <
|
|
13
|
+
for (let i = 0; i < 20000; i++) {
|
|
14
14
|
const earliest = dayjs().subtract(u.rand(2, 360), 'D');
|
|
15
15
|
dates.push(timeSoup());
|
|
16
16
|
}
|