2

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?

2

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.

|improve this answer|||||
  • I get results, but not from the specified time range. Maybe that helps solve the bug? – Paul Apr 18 '17 at 12:55
  • Try downloading the latest version of Calendar to resolve this issue :) – Solspace Apr 21 '17 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.