Problem/Motivation
Particularly for recurring dates with many instances, it may not be useful to list all instances.
Proposed resolution
Provide a specialized output formatter with appropriate configuration options:
- Show the plain text description of the rule (as provided by the recurr library's TextTransformer)
- Show a configurable number of upcoming instances (hard limit)
- Show a configurable number of upcoming instances, after which the instances will be hidden (soft limit)
- Show a configurable number of past instances (hard limit)
- Show a configurable number of past instances, after which the instances will be hidden (soft limit)
The idea with the hard/soft limits above is similar to how facets work in Drupal. The hard limit is the total number rendered to the page, but any beyond the soft limit will be hidden, with some kind of "show more" link to view them.
Here's what the result looks like (note: each type of past/upcoming set is in a details elements)

| Comment | File | Size | Author |
|---|---|---|---|
| #7 | smart_date-recurring-output-formatter-3105663-7.patch | 8.42 KB | mandclu |
| #2 | Screen Shot 2020-01-16 at 11.01.38 AM.png | 65.95 KB | mandclu |
Comments
Comment #2
mandclu commentedThe attached patch isn't quite as fancy as the original description, but it does allow for showing a configurable number of rows for both upcoming and past instances, as well as the text of the rule.
Comment #3
mandclu commentedRealized I had a slight inconsistency in how the output was being structured. This updated patch should fix that
Comment #4
steven buteneers commentedI do like this feature and I was in fact looking for such a formatter to limit/summarise the output of recurring dates.]
The only problem I'm having with this is that it's now forced in a detail field. This is not really a nice solution for views rendering a teaser where I would like to use this kind of functionality.
I'm not quite sure what would be the best approach for this, perhaps providing some output options (E.g. plain, details etc..) to manipulate the output a bit more.
Edit:
1: After selecting this formatter I'm also getting some warnings in DBlog:
2: I'm unable to set 0 (none) as a value for upcoming or past events. I want to be able to either show only upcoming events, only past events or both.
Comment #5
mandclu commentedThis updated patch adds an ability to select either details or a div container in the output configuration. In the latter case, the headings are set in an h4.
This should also fix the dblog warnings.
As for showing past or future events, I assume you're referring to a filter value for views. In my experience using a value of "now" (no quotes) will achieve what you're after.
Comment #6
steven buteneers commented@mandclu ; I was referring to the settings where you can configure Recent and Upcoming Instances to show. If you set this to 0 it still shows them.
I was also thinking that maybe a theme implementation would be a better way to solve the output of the items? So themers can just override the template(s).
Comment #7
mandclu commentedGreat suggestion about the theme implementation. This patch adds a twig template, which is a much better way to let a particular site customize the output to suit its needs, including not only the structure, but also the labels, etc.
I believe the issue with continuing to show values with a zero specified should be fixed now too.
Comment #9
mandclu commentedI decided to merge this in so we can have a beta release. Please reopen if you find any issues.