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

CC BY-SA 3.0
2017-12-13T09:32:09.637Z
2017-12-13T09:32:09.637Z
Panos Spiliotis
<p>Do you mean <a href="https://solspace.com/craft/calendar/docs/searching-events/#calendar-events" rel="nofollow noreferrer">this</a>?</p>

<pre><code>{% set eventOptions = {
    dateRangeStart: targetStartDate,
    dateRangeEnd: targetEndDate,
    limit: 15,
    search: "EndrepeatHandle:On date"
} %}
{% set events = craft.calendar.events(eventOptions) %}
</code></pre>

CC BY-SA 3.0
2017-12-12T19:35:27.013Z
That doesn't seem to be returning anything at all. I would like to be able to get a list of events that repeat and output their start and end dates. Eg. "Title of an event: From March 1, 2017, to December 20, 2017" where "December 20, 2017" is the last repeat date selected in the settings of the event.
Panos Spiliotis
CC BY-SA 3.0
2017-12-12T19:38:26.553Z
Maybe your query is wrong? Would you mind posting it?
Robin Schambach
CC BY-SA 3.0
2017-12-12T19:50:40.683Z
This is the type of query I use:

`{% set eventOptions = {
dateRangeStart: '2017-12-1',
dateRangeEnd: '2017-12-31',
search: "EndrepeatHandle:On date"
} %}
        
{% paginate craft.calendar.events(eventOptions) as pageInfo, events %}
...`
Panos Spiliotis
CC BY-SA 3.0
2017-12-12T19:52:42.350Z
Of course that will return null.. I wanted to state that you have to include the handle of your end repeat field like stated in the docs. Maybe you have to quote the `On date` or use wildcards. It's working like the original craft parameter
Robin Schambach
CC BY-SA 3.0
2017-12-12T19:59:19.707Z
The "End Repeat" field is not a custom field. It's the one that Calendar uses to set the end date. I couldn't find a way to reference that in the documentation of the plugin.
Panos Spiliotis
CC BY-SA 3.0
2017-12-12T11:16:02.580Z
2017-12-12T11:16:02.580Z
Robin Schambach
<p>I want to output a list of events some of which are repeating, on a monthly basis. Each event should show up once even if it's scheduled to repeat multiple times in the same month and the information for each event must also include the date of last occurrence if there is one. </p>

<p>To be a little bit more specific I would like to access the value of the field "End repeat" when it's value is set to "On date".</p>

<p>Is this possible?</p>

<solspace><plugin-solspacecalendar>
Is there a way to retrieve the last date of an event using the Solspace calendar plugin?
# Is there a way to retrieve the last date of an event using the Solspace calendar plugin?

(Asked by: username_0 on 2017-12-08)

I want to output a list of events some of which are repeating, on a monthly basis. Each event should show up once even if it's scheduled to repeat multiple times in the same month and the information for each event must also include the date of last occurrence if there is one.

To be a little bit more specific I would like to access the value of the field "End repeat" when it's value is set to "On date".

Is this possible?

**Tags:** solspace, plugin-solspacecalendar

---

## 2 answers

### Answer by username_0 on 2017-12-13. Score: 1 | Accepted answer

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.


---

### Answer by username_1 on 2017-12-12. Score: 1

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

> **Comments:**
> **username_0**: That doesn't seem to be returning anything at all. I would like to be able to get a list of events that repeat and output their start and end dates. Eg. "Title of an event: From March 1, 2017, to December 20, 2017" where "December 20, 2017" is the last repeat date selected in the settings of the event.  
> **username_1**: Maybe your query is wrong? Would you mind posting it?  
> **username_0**: This is the type of query I use:  `{% set eventOptions = { dateRangeStart: '2017-12-1', dateRangeEnd: '2017-12-31', search: "EndrepeatHandle:On date" } %}          {% paginate craft.calendar.events(eventOptions) as pageInfo, events %} ...`  
> **username_1**: Of course that will return null.. I wanted to state that you have to include the handle of your end repeat field like stated in the docs. Maybe you have to quote the `On date` or use wildcards. It's working like the original craft parameter  
> **username_0**: The "End Repeat" field is not a custom field. It's the one that Calendar uses to set the end date. I couldn't find a way to reference that in the documentation of the plugin.  

---

