summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-07 13:02:15 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-07 13:02:15 +0100
commitab14b7e4b6efdc69ba9b21cacb2d4840bf7351b1 (patch)
treef690e3f79c37e329b188e05cb874580b01ef293e
parentDress for the occasion (diff)
downloadtoy-ab14b7e4b6efdc69ba9b21cacb2d4840bf7351b1.zip
Allow events to be scheduled for today if there's time
-rw-r--r--scripts/toy/social.groovy2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/toy/social.groovy b/scripts/toy/social.groovy
index 384b0a2..0a6c179 100644
--- a/scripts/toy/social.groovy
+++ b/scripts/toy/social.groovy
@@ -6,7 +6,7 @@
toy.metaClass.setupPlan { plan, float startmin, float startmax, float endmin, float endmax ->
final timeWindow = { float min, float max -> (int)((min * HOUR) - localTimeOffset() + getRandom((int)((max - min) * HOUR))) };
final friendName = FRIENDS[getRandom(FRIENDS.size())];
- final day = getDay() + ((getRandom(3) + 1) * DAY);
+ final day = getDay() + ((getRandom(3) + (localTime() > startmin ? 1 : 0)) * DAY);
addEventIfMissing(plan, day + timeWindow(startmin, startmax), BEGINPLAN,
[friendName: friendName, returnTime: day + timeWindow(endmin, endmax)]);
}