5

Edited to provide a cleaner solution: This code will display different contents for available times and unavailable times in 30 min increments, and makes no assumption on how long your events are. {% set targetDate = "today" %} {% set events = craft.calendar.events({ dateRangeStart: targetDate, dateRangeEnd: targetDate }) %} {% for hour in craft....


4

Not sure if I totally got it but you can check the class of an object via {% if element is instance of ('craft\\elements\\Entry') %} or via switch statement {% switch className(element) %} {% case 'craft\\elements\\Entry' %}


4

Sorry about the trouble. We typically answer most tickets within 24 hours: Freeform: https://solspace.com/craft/freeform/support/ Calendar: https://solspace.com/craft/calendar/support/ If the Support Form isn't working for you, you can always email us directly at support@solspace.com :)


3

Looking at the docs you can search for events for a certain calander by including the id or the handle in your query. {% set calendars = craft.calendar.calendars({ limit: 100, order: "name", sort: "asc" }) %} {% for calendar in calendars %} {% set events = craft.calendar.events({ calendarId: calendar.id }) %} {% if events|...


3

Unfortunately this won't be possible with Solspace Calendar since we are extending ElementCriteria with Calendar_EventCriteriaModel, which has a layer on top of it allowing us to build recurring events and return a padded list of events. We also return Event objects instead of EventModel objects, because working with Craft Dates makes it difficult/impossible ...


2

To listen to Craft Commerce order save event, you must make a new plugin (or use an existing one) and in it's ::init() method, listen to the commerce_orders.onSaveOrder event: class TestPlugin extends BasePlugin { public function init() { parent::init(); craft()->on( "commerce_orders.onSaveOrder", function ...


2

There currently isn't any built in Location field for Calendar. We made add something like that in the future, but for now you can definitely use other third party field types such as VZ Address to handle this. :)


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 ...


2

Sorry, Calendar currently does not allow for importing of any events via ICS or other means. source: Kelsey Martens, Director of Software Operations


2

This is a known issue and will be resolved in Beta 4 coming out today (March 15, 2018). Sorry for the trouble.


2

This currently isn't built into Calendar, but if your calendars use the same fields, you should be able to manually adjust the calendarID column in the craft_calendar_events database table. Otherwise, you'll have to delete the event and create it again for the correct calendar. Sometime in the future we plan on seeing if we can add the option to allow ...


2

The solution is to wrap the event output in a conditional that compares the event startdate to now. I've updated the question to reflect this.


2

Try contacting them on the Craft CMS Slack workspace. They have an account on there, it's worked for me in the past!


2

I think you will have to get your hands a bit dirty with this one. The Calendar Events fieldtype will get you part of the way, but you still need some module code to pull this off. A suggested approach is: Create a product type with the Events fieldtype Create some module code that creates/updates a product + variants for each date, where the inventory is ...


2

You'll want to make sure you include all of the Calendar field inputs in order for this to work. If you're trying to hide them for your workflow, you can set the fields to hidden, or wrap them in a div and hide them with CSS. :)


2

I got help on Discord. The way to do it was Calendar::getInstance()->events->saveEvent($event); Edit: DateTime also needs to be replaced with Carbon()


1

Thanks to Kelsey Martens of solspace I found the key. The solspace demo calender uses the .format() method which doesn't translate to the sites language. Now I use the |date filter instead which translates also month and daynames.


1

Calendar's event recurrences are only simulated/inflated by a repeat rule for the main event. Since there is no database entry for each recurrence, there's unfortunately no way to achieve something like this at this time.


1

I emailed Solspace support about this and had an answer: Unfortunately it's not possible to have the SQL order events like you need, because after the SQL fetches the events, we have to hydrate all occurences that any given event might have, and then reorder the bulk separately since occurrences usually change the order of all events. We might be ...


1

After experimenting with syntax a bit I made it work, looks like it needs an id, but it doesn't work with the event as an object. So this works: {% set reviews = craft.entries.section('reviews').relatedTo(event.id) %}


1

You can use them the same way like you are used to everywhere else. All relation fields extend the same BaseRelationField so their logic is totally equal. You can either pass an element, an element id or an ElementQuery/ElementCriteriaModel but not a string to the function. If you want to fetch all related elements of an event you'll need to fetch the event ...


1

Currently Calendar does not support eager loading, but it's much more likely the Craft 3 version will in the future, as we refactored a lot of code and tried to somewhat "normalize" the code to work more natively with Craft than we did in Craft 2.


1

Have you checked what values you have for the calendar(s) under the Site Settings: Event URI Format & Template It's possible you might have something incorrect there. Perhaps the Template path inside the Event URI Format area, instead of a proper value like /calendar_demo/event/{slug}.


1

The calendar.month function is designed to only display complete months, so as long as you specify a date, it's going to show you events for that whole month (before and after). What you're looking for is the calendar.events function: https://solspace.com/craft/calendar/docs/calendar.events/ The code to display events starting from today plus 1 month (+30 ...


1

It turns out that the Calendar plugin provides a property named event.repeating that can be checked to determine if the event is repeating and then use event.readableRepeatRule property to output the last date that the event will repeat on.


1

Do you mean this? {% set eventOptions = { dateRangeStart: targetStartDate, dateRangeEnd: targetEndDate, limit: 15, search: "EndrepeatHandle:On date" } %} {% set events = craft.calendar.events(eventOptions) %}


1

UPDATED RESPONSE... We were finally able to get to the bottom of this and traced the issue down to your site likely having a DateTime field with the handle date, and this was apparently something Craft was choking on. The next version of Calendar will fix this, but you can resolve this by renaming that DateTime field or patch this by looking for this code ...


1

There's a definitely a syntax error in your first line. ({ loadOccurrences: false }) should be: { loadOccurrences: false } Also, from their docs, the export method only shows one parameter being passed in and you've specified two.


1

If you're referring to adding extra fields to what a calendar itself contains (for displaying additional content with Calendar object), then that currently is not possible. Only the built in options are available.


1

You'd do it from the Calendar's field layout page (https://solspace.com/craft/calendar/docs/calendars/), just like Craft entries, users, categories, etc.


Only top voted, non community-wiki answers of a minimum length are eligible