Using Solspace Craft Calendar plugin, how can I get random events within a defined timeframe? I'm trying to achieve the following (without much luck), using Solspace Calendar plugin:


All events (no calendar specified)
A defined timeframe (one week)
Only unique events, that have at least 1 occurrence in that week, so no reoccurrences
In a random order
Limited to a specified number


I tried, without satisfying result:

{% set events = craft.calendar.events({
    dateRangeStart: now |date('Y-m-d'),
    dateRangeEnd: now |date_modify('+7 days') |date('Y-m-d'),
    order: 'RAND()',
    loadOccurrences: false,
    limit: 3,
}) %}


Any Calendar experts out there?
UPDATE: This issue has been fixed as of Calendar 1.8.4 on April 21, 2017.
https://solspace.com/craft/calendar

Your above code should work. I think there might be a bug with the loadOccurrences: false parameter used in conjunction with the limit: 3 parameter. Try increasing the limit to something higher and see if you get results. :)

In the meantime, I've logged this bug and we'll have a bug fix for this in the near future. Sorry for the inconvenience.