diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-07-07 13:02:15 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-07-07 13:02:15 +0100 |
commit | ab14b7e4b6efdc69ba9b21cacb2d4840bf7351b1 (patch) | |
tree | f690e3f79c37e329b188e05cb874580b01ef293e /scripts | |
parent | Dress for the occasion (diff) | |
download | toy-ab14b7e4b6efdc69ba9b21cacb2d4840bf7351b1.zip |
Allow events to be scheduled for today if there's time
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/toy/social.groovy | 2 |
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)]); } |