Attached patch is needed to make calendar templates work with date_recur. Not yet submitted to calendar.module as this should be abstracted somehow to not have to call into date_recur directly. Posting here for the moment to make the patch available.

CommentFileSizeAuthor
#58 2820803-58.patch15.63 KBheshanlk
#57 caleandar-patch.patch15.95 KBheshanlk
#54 2820803-54.patch15.57 KBSuresh Prabhu Parkala
#50 2820803-date-recur_calendar-integration-50.patch17.84 KBwangshy
#50 interdiff.txt1.21 KBwangshy
#49 2820803-date-recur_calendar-integration-49-1.0.0-alpha2.patch17.84 KBwangshy
#49 interdiff.patch1.21 KBwangshy
#45 2820803-date-recur_calendar-integration-45.patch16.84 KBmrinalini9
#44 2820803-date-recur_calendar-integration-44.patch16.87 KBmrinalini9
#42 interdiff_18_39.txt280 bytesElin Yordanov
#39 2820803-date-recur_calendar-integration-39.patch79.24 KBElin Yordanov
#37 2820803-date-recur_calendar-integration-37.patch17.83 KBsolide-echt
#37 interdiff.txt6.03 KBsolide-echt
#34 2820803-date-recur_calendar-integration-34.patch17.01 KBsolide-echt
#31 2820803-date-recur_calendar-integration-31.patch12.39 KBsolide-echt
#27 image-20200326023412-4.png174.14 KBrwilson0429
#27 image-20200326020352-1.png218.19 KBrwilson0429
#27 image-20200326022343-3.png128.68 KBrwilson0429
#27 image-20200326021750-1.png108.98 KBrwilson0429
#25 2820803-date-recur_calendar-integration-20.patch954 byteslobodakyrylo
#23 2820803-date-recur_calendar-integration-19.patch1 KBlobodakyrylo
#23 Events+%28Content%29++Pirate+Party+2019-10-01+10-56-00.jpg389.54 KBlobodakyrylo
#18 2820803-date-recur_calendar-integration-18.patch79.28 KBmmaranao
#17 Screen Shot 2019-05-23 at 12.55.35 PM.png17.6 KBmmaranao
#17 2820803-date-recur_calendar-integration-17.patch83.08 KBmmaranao
#8 2820803-date-recur_calendar-integration_8.patch83.07 KBakalata
#6 2820803-date-recur_calendar-integration_6.patch83.56 KBakalata
#5 2820803-date-recur_calendar-integration_5.patch85.03 KBakalata
#4 2820803-screenshot-4.png80.59 KBlonalore
#4 2820803-screenshot-4.png80.59 KBlonalore
#2 2820803-date_recurd-add-required-function-2.patch772 byteskporras07
calendar-date_recur.patch1.09 KBFrando

Issue fork calendar-2820803

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Frando created an issue. See original summary.

kporras07’s picture

Version: » 8.x-1.x-dev
FileSize
772 bytes

The previously attached patch uses an unexisting function in date_recur; I'm adding it with this patch.

OllaanKoodeis’s picture

Should this work with Calendar? In my setup all recurring dates are shown only in the first date's column. I mean for example there's an event with 4 recurring dates on Tuesdays until 3th of Oct. All the 4 dates are printed in the 12th of Sep date column but nothing for next three Tuesdays columns.

lonalore’s picture

@KJankko Calendar module only has a "dev" version (which contains a lot of bugs) and will change a lot in the future. So, (currently) it would be rather difficult to find a (permanent) solution to make Calendar and DateRecur modules work together without any conflict. But I have a "solution", which is currently working well.

So, I got Calendar and DateRecur modules working together with the following steps:

1, First of all, I applied some patch files for the modules:

Calendar
https://www.drupal.org/node/2901594 (#14) (partially... I changed some CSS styles)
https://www.drupal.org/node/2845257 (#10)
https://www.drupal.org/node/2859127 (#3)
https://www.drupal.org/node/2644232 (#11)

Date Recur Field (repeating dates)
https://www.drupal.org/node/2820803
https://www.drupal.org/node/2902501 (#2)

2, I created my custom @ViewsRow and @ViewsStyle plugins in my custom module

I uploaded them as a Github Gist file. You can find them here:

[CUSTOM_MODULE]/src/Plugin/views/row/DateRecurCalendar.php
[CUSTOM_MODULE/src/Plugin/views/style/DateRecurCalendar.php

3, Create your calendar views and change "Format" style to "Calendar (with Date Recur)" and change "Show" style to "Calendar entities (with Date Recur)"

Demonstration

Furthermore, I had to alter view queries in order to add additional conditions, because Views only adds the following condition for DateRecur fields:

(DATE_FORMAT(date_recur__ENTITY_TYPE_ID__FIELD_NAME.FIELD_NAME_value, '%Y%m') = '201709')

The condition above is used for a "month" Calendar, but it does not cover all events for September 2017, because what about events start before September and will be end in September or October? So, I add additional conditions to the query to support Date ranges too:

(DATE_FORMAT(date_recur__ENTITY_TYPE_ID__FIELD_NAME.FIELD_NAME_value, '%Y%m') = '201709') OR
(
  (DATE_FORMAT(date_recur__ENTITY_TYPE_ID__FIELD_NAME.FIELD_NAME_value, '%Y%m') <= '201709') AND
  (DATE_FORMAT(date_recur__ENTITY_TYPE_ID__FIELD_NAME.FIELD_NAME_end_value, '%Y%m') >= '201709')
)

Note: Calendar template files ("week" and "day") don't support multi-day, all-day events, the related code is commented out, so I had to play with template files too. So, currently, Calendar module is a disaster... :/

Alternative solution: Use FullCalendar module with the changes you can find in this pull-request.

akalata’s picture

@lonalore thanks for posting this!

Is there a reason against adding your row and style plugins to date_recur?

I've added those in with the attached patch (for date_recur), which along with the original patch for calendar has things up and running for me. I'm still testing it out, but haven't needed to add any of the other patches you mentioned.

akalata’s picture

FileSize
83.56 KB

Tried to take a shortcut when making #5, didn't work out as I had hoped!

akalata’s picture

Coming back a few weeks later and I'm confused by this issue thread, and I knew what was going on at one point!

We have 3 sets of code changes here:

#0 - @Frando's original patch for the calendar module.
#2/#6 - Patches for date_recur to support the patch for calendar module.
#4 - Includes links to date_recur row and style plugins for calendar views. #6 includes these as well.

Since there are good comments and explanations here, and working on code for date_recur, I think that the original patch for calendar should be moved to a new issue that is marked as "Postponed" (or something else to discourage date_recur work there), with a reference to this issue.

=====

Now the reason I found myself back here: Reporting that something with the Calendar integration is broken when using Monthly rules -- the first date per month is not displaying in the calendar. Ex: Monthly on the first Friday of the month will display nothing on the calendar, but Monthly on the first and second Fridays will display an event on the second Friday only. See below.

akalata’s picture

Status: Active » Needs review
FileSize
83.07 KB

I had thought the issue was with the first event on a monthly view, but it's really the first time any repeating event is set to view via the calendar.

I've tracked it to where DateRecurRRule->createOccurrences() is comparing dates to add to the occurrences list.The $start date is in my site's local timezone:

stdClass Object
(
    [__CLASS__] => DateTime
    [date] => 2017-12-04T21:00:00-06:00
    [timezone] => America/Chicago
)

However, the $occurrence dates are in a different timezone type and format:

stdClass Object
(
    [__CLASS__] => DateTime
    [date] => 2017-12-04T21:00:00+00:00
    [timezone] => Z
)

When the code compares the two DateTimes to see if $occurrence is after $start, the comparison fails. I don't know the actual mechanics of this object comparison, but calling getTimestamp() on both gives (1512421200 > 1512442800 = FALSE).

The handoff from the calendar display to date_recur processing is in the row style DateRecurCalendar at $occurrences = $occurrenceHandler->getOccurrencesForDisplay($dateMin, $dateMax, 1);. Calendar wants to use our time zone, but RRule wants UTC. The workaround is to add the UTC offset to the timestamp and reset the timezone. @lonalore had similar code in their gist a bit later on, so I've just followed that model.

The patch included here incorporates this change and generally brings the views row and style plugins up-to-date with their core counterparts (the gist has different code styles and other automated cleanup which makes it harder to diff).

brooke_heaton’s picture

I'm a bit confused by this whole thread and the patches. Do I understand correctly that 2820803-date-recur_calendar-integration_8.patch will work properly if combined with a custom module? Are we trying to add /src/Plugin/views/row/DateRecurCalendar.php to a contrib module? Should this not go in as a patch rather than a custom module?

brooke_heaton’s picture

duplicate comment

SocialNicheGuru’s picture

Status: Needs review » Needs work

if the calendar module is not enabled I get a WSOD and this error:
Fatal error: Trait 'Drupal\calendar\CalendarViewsTrait' not found in -drupal-8.4.4/html/modules/contrib/date_recur/src/Plugin/views/row/DateRecurCalendar.php on line 33

it would be nice if it failed gracefully if the calendar module is not installed

firewaller’s picture

@akalata patch #8 does not seem to be working for me on a clean Drupal 8.4.5 install with calendar (8.x-1.x-dev) and date_recur (8.x-1.0-alpha). With or without the patch, the calendar month view seems to do the following:

  • Item with date_recur single date: Shows item as normal
  • Item with date_recur multi date: Shows item 1st instance only
  • Item with date_recur single date with repeat: Does not show item instanced at all
akalata’s picture

Re #9 and #12: Patch #8 was a work in progress, I would recommend #6 which iirc is what I'm currently using.

Also re #12: The Calendar module also needs to be patched with the unnumbered patch included in the original post of this issue. Based on your comment I am not sure that this patch was applied.

I am working on figuring out what changes need to be made now that #2627512: Datetime Views plugins don't support timezones is in Core 8.5 and the work on #2604546: Timezone handling in Calendar. I have not decided whether I'm chasing an implementation for 8.4 or 8.5 at this point (functionality is needed for an existing client project that has not yet been updated).

akalata’s picture

In my limited testing, the patch from #2699477-66: Steps towards handling end dates in Calendar 8 (for the calendar module) accomplishes the same result as the un-numbered calendar-date_recur.patch from the OP, without any hardcoding -- yay!

My current, working setup is as follows:

brooke_heaton’s picture

Thanks for the update @akalata. Will review.

dpi’s picture

Title: Patch for calendar module » Support recurring dates in calendar
Project: Recurring Dates Field » Calendar

Moving to Calendar project.

Date Recur 2.x is stable enough to start developing against.

Patch needs rework, IMO a part of Calendar, not DR.

mmaranao’s picture

Hi guys,
Trying to make sense of all these, but I still haven't gotten it to work and am getting the following error:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\date_recur\Plugin\Field\FieldType\DateRecurItem::getOccurrenceHandler() in Drupal\date_recur\Plugin\views\row\DateRecurCalendar->render() (line 378 of modules/contrib/date_recur/src/Plugin/views/row/DateRecurCalendar.php).

My current setup is as follows:

Drupal core 8.7.1
drupal/date_recur 8.x-2.0-beta4
- patch https://www.drupal.org/files/issues/2019-05-23/2820803-date-recur_calend...
drupal/calendar 8.x-1.x-dev
- patch https://www.drupal.org/files/issues/2018-04-06/calendar-date_range-26994...
- patch https://www.drupal.org/files/issues/2019-01-19/calendar-timezone-2604546...

Attached also is my current calendar view settings:
https://www.drupal.org/files/issues/2019-05-23/Screen%20Shot%202019-05-2...

Any help would be appreciated, thanks!

mmaranao’s picture

After spending a few more time on this, I was able to figure it out and reworked the patch to make it work for the month calendar view.

Syntapse’s picture

Subscribing. Do project maintainers intend to integrate support for recurring dates in calendar? If so is there any idea when? Thanks.

dpi’s picture

Please make sure interdiffs are provided when uploading new patches, as this patch is already significant in size.

Jennyu’s picture

I patched 2820803-date-recur_calendar-integration-18.patch

Got the following response:
patching file 2820803-date-recur_calendar-integration-18.patch
Hunk #1 FAILED at 19.
1 out of 1 hunk FAILED -- saving rejects to file 2820803-date-recur_calendar-integration-18.patch.rej

Then I checked Calendar module:
I did get two DateRecurCalendar.php files under /src/Plugin/views/row and /src/Plugin/views/style.

But when I tried to change Calendar view Format and Show, I chose "Calendar(with Date Recur)" and "Calendar entities(with Date Recur)", and Clicked "apply" -- Just can't apply.

iwarmbro’s picture

Also unable to save newly available "Calendar (with Date Recur)" option, but after successfully applying patches.

lobodakyrylo’s picture

I applied patch #18 and couldn't set my view up to show recurring dates. But I used another way to do it.

I attached the new patch that works well for me and an explanation of how it works.

sagesolutions’s picture

@iwarmbro I had the same issue..

I see the option Calendar (with Date Recur), but I'm unable to save. When i click "Apply", I get an AJAX error

AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/ajax/display/calendar/page_month/style
StatusText: Internal Server Error

Turns out, I had to apply the #18 patch to the date_recur module, and #19 to the calendar module

lobodakyrylo’s picture

My patch described in #23 comment is not working anymore. I've made a new one.

sagesolutions’s picture

I've updated calendar to the latest, and applied patch #18 to date_recur module, and patch from comment #25 to calendar module. Both patches applied successfully, but the recurring date is no longer shown in the calendar.

I used the same setup at in the https://www.drupal.org/files/issues/2019-10-01/Events%2B%2528Content%252... image from #23

rwilson0429’s picture

@SageSolutions, I think its your Contextual filters. I was able to get the Calendar module working with Date Recur using patch in #18 in this issue and, patch #20 at https://www.drupal.org/node/2901594. Note: I've not tried the patch in #25. The summary of steps below pertain to the Calendar's month view, however, it worked for the week and day view as well for me.

Modules I used:

Patches I used:

Create Some Content to use in the Calendar View

Add a Date Recur field to a content type.  For this example, I will be using an "Event" content type with a date recur field named 'event_date_recur.'

Add some content using the date recur field that you setup.

Create a Calendar View:

  1. Under Format:
    1. Format: select Calendar (with Date Recur)
    2. show: Calendar entities (with Date Recur)
  2. Under Fields:
    1. Add your Recur date field and configure it.
    2. Add the content Title field, or whatever fields you want to display in the calendar.
  3. Under the Page Settings, provide a Path something like:
    1. Path: /events/calendar/month
  4. Under the Advanced Section:
    1. Create a Relationship of 'Occurances of [YOUR DATE RECUR FIELD]'.   Require this relationship.
      image-20200326021750-1
    2. Create a Contextual Filter of 'Content: [YOUR DATE RECUR FIELD]: first occurrence start date (year_month)'
      1. When the filter value is NOT in the URL: Provide Default of Calendar Current date
      2. When the filter value IS in the URL or a default is provided:
        1. Specify Validation Criteria: Calendar Date Format
        2. Replacement Date Pattern: F Y
      3. image-20200326022343-3

Here is what my Calendar month's View looks like:

image-20200326020352-1

 

Here is results of the Calendar month view:

image-20200326023412-4

solide-echt’s picture

I was able to get this working with Calendar 8.x-1.x-dev and Date Recur stable release 8.x-2.0 without any of the other modules, along the lines of #27. I found it very confusing this patch is against date_recur module, NOT calendar, even though it was addressed in #5.
The plugins installed by the patch are essentially copies of the row and style plugin for Calendar module. If we want to proceed with that IMHO this patch should be judged by the maintainers of Date Recur, not Calendar.

My first priority as maintainer for Calendar is to investigate what it takes to get Date Recur working in the 8.x-2.x branch, since this branch uses default row plugins. I am getting an error but it looks well isolated (the __clone() method doesn't work on date_recur occurances).

Eric

solide-echt’s picture

Created a new issue with patch for 8.x-2.x branch, see #3127308: Support Recurring Dates Field in Calendar 8.x-2.x. Hope to find some time coming week to rework this against 8.x-1.x.

rhiss’s picture

While testing #27, it seems like the view shows the 'event' (rrule) only at the startdate month, no monthly or inter-month recurring dates.

solide-echt’s picture

Here's a new patch to integrate date_recur. This patch is against calendar 8.x-1.x-dev, NOT against date_recur!
As for the comment made by rhiss in #30: this is a missing feature in 8.x-1.x branch and not specifically happening with recurring dates. E.g. if you have a datetime_range node which starts before your current calendar it is not shown as well. In the 8.x-2.x branch this is solved by using calendar specific argument plugins.

solide-echt’s picture

Category: Plan » Feature request
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 31: 2820803-date-recur_calendar-integration-31.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

solide-echt’s picture

fixed as much of the coding comments as possible.

banoodle’s picture

Status: Needs work » Needs review

Excited to see there is a patch - will try to review tomorrow.

dpi’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/views/row/Calendar.php
    @@ -416,6 +411,18 @@ class Calendar extends RowPluginBase {
    +      $moduleHandler = \Drupal::service('module_handler');
    

    should be injected

  2. +++ b/src/Plugin/views/row/Calendar.php
    @@ -416,6 +411,18 @@ class Calendar extends RowPluginBase {
    +        $field_argument_config = \Drupal::entityTypeManager()
    

    should be injected

  3. +++ b/src/Plugin/views/row/Calendar.php
    @@ -416,6 +411,18 @@ class Calendar extends RowPluginBase {
    +        if ($field_argument_config->getTypeProvider() === 'date_recur') {
    

    I dont think you should be looking for provider. You should be able to use instanceof Daterecuritem somehow, in order to capture any field types that extend date_recur

  4. +++ b/src/Plugin/views/row/Calendar.php
    @@ -453,21 +461,24 @@ class Calendar extends RowPluginBase {
    +        $item_start_date = \DateTime::createFromFormat($storage_format,
    

    datetime/daterange/date_recur all have a computed datetime object helper. You should be able to do $item[0]->start_date / $item[0]->end_date instead of needing to use \DateTime::createFromFormat in many places.

  5. +++ b/src/Plugin/views/row/Calendar.php
    @@ -539,87 +558,109 @@ class Calendar extends RowPluginBase {
    +    if ($calendar_event->recurring instanceof \Drupal\date_recur\Plugin\Field\FieldType\DateRecurItem) {
    

    use of FQN

  6. +++ b/src/Plugin/views/row/Calendar.php
    @@ -539,87 +558,109 @@ class Calendar extends RowPluginBase {
    +        $item_start_date = \DateTime::createFromFormat($calendar_event->storage_format, $occurrence->getStart()->format('Y-m-d\Th:i:s'), $calendar_event->getTimezone());
    

    see above re using computed fields

  7. +++ b/src/Plugin/views/row/Calendar.php
    @@ -539,87 +558,109 @@ class Calendar extends RowPluginBase {
    +      $item_start_date = $event->getStartDate()->getTimestamp();
    

    You should avoid using timestamps in any code because dates may not be after 1970, and its best to not store or manipulate dates in integer form due to variable length/memory issues

  8. +++ b/src/Plugin/views/row/Calendar.php
    @@ -539,87 +558,109 @@ class Calendar extends RowPluginBase {
    +        $start = $this->dateFormatter->format($next->getTimestamp(), 'custom', 'Y-m-d H:i:s');
    

    Using dateformatter (with timestamp) opens you up to not supporting out of range ints (pre 1970)

Skimmed through for a code review. Not a technical/big picture review.

solide-echt’s picture

Daniel,

Thank you for your thorough feedback. I wasn't sure how to handle injection without date_recur becoming a dependent module but found a reference using a stub service that can be included in calendar. This makes the code in row plugin much cleaner, no need for getTypeProvider(). As to 5: I think we can safely assume $calendar_event->recurring by definition is a DateRecurItem or is null; I want to avoid having date_recur in the 'Use" section as this implies a dependency.

Usage of timestamp and dateformatter (with timezone) was part of the 8.x-1.x code all along. Though I fully agree I think we should leave this to the 2.x branch (where DrupalDateTime class is used as much as possible).

dpi’s picture

The two mentioned services for DI are from core. There was no dependency on a DR service in my notes above.

Imports may be used even if the class does not exist. For example I can do $obj instanceof A\Class\That\Doesnt\Exist. Introducing use does not imply a dependency.

Looking at the interdiff at 37, I dont understand why you need to depend on any DR services.

Elin Yordanov’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Needs work » Needs review
FileSize
79.24 KB

Re-rolled the patch #18

heshanlk’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
solide-echt’s picture

@Елин Й. Could you provide an interdiff? Thx.

Eric

Elin Yordanov’s picture

FileSize
280 bytes

@solide-echt,

I just added the missing new line at the end of the file. See the interdiff file. And I just realized that this patch is for date_recur module, not for calendar. I got this patch in a project which was not applying because of the missing new line.

sagesolutions’s picture

Status: Needs review » Needs work

Patch #37 fails to apply to the calendar module.

mrinalini9’s picture

Status: Needs work » Needs review
FileSize
16.87 KB

Rerolled patch #37, please review.

mrinalini9’s picture

Please ignore patch #44, here is the rerolled patch for #37, please review.

Status: Needs review » Needs work

The last submitted patch, 45: 2820803-date-recur_calendar-integration-45.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mrinalini9’s picture

Status: Needs work » Needs review
solide-echt’s picture

Please don't post patches that apply to the date_recur module in the calendar issues thread. The latest patches should be applied to the calendar module.

Thanks,
Eric

wangshy’s picture

Add support to argument context from relationship(interdiff.patch), otherwise recurred date over span more than one month can't show up normally (which should use "date_recur" table related to node instead of field from node directly).

Reroll patch for 1.0.0-alpha2 for production version

wangshy’s picture

mistake on #49 patch. #50 is the right one to support relationship and reroll on 1.0alpha2

wangshy’s picture

The patch is still not perfect yet at it displays only first recur date instead of date of each occurrence. So far workaround is hiding date but leaving time only.

Neslee Canil Pinto’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Latest patch is not applying, can you please reroll

Suresh Prabhu Parkala’s picture

Assigned: Unassigned » Suresh Prabhu Parkala
Suresh Prabhu Parkala’s picture

Status: Needs work » Needs review
FileSize
15.57 KB

Re-rolled patch please review.

Status: Needs review » Needs work

The last submitted patch, 54: 2820803-54.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dankegel’s picture

Sounds like this is close... can anyone comment on the usability of Calendar on drupal 9, including recurring dates?

heshanlk’s picture

FileSize
15.95 KB

Re-rolled

heshanlk’s picture

Status: Needs work » Needs review
FileSize
15.63 KB

Status: Needs review » Needs work

The last submitted patch, 58: 2820803-58.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sagesolutions’s picture

I applied the patch #58 along with Recurring Dates Field 8.x-2.2 on Drupal 8.9.13

I also added the #39 patch https://www.drupal.org/files/issues/2020-05-20/2820803-date-recur_calend..., but not sure if this was required.

I ended up using Format: Calendar and Show: Calendar Entities in the calendar month view.

Everything seems to be working properly.

Ruslan Piskarov made their first commit to this issue’s fork.

Christopher Riley’s picture

I would love to check out this functionality however patch 58 doesn't apply and I am confused what was done in 62. Can someone please advise?

Thanks in advance.

Sseto’s picture

I'm on the same boat as Christopher Riley.

kporras07’s picture

Hi,

Comment #58 was a Merge Request. You can find it by clicking on "merge request !6". You can see the code at https://git.drupalcode.org/project/calendar/-/merge_requests/6 and could downloading as patch at https://git.drupalcode.org/project/calendar/-/merge_requests/6.patch

You could also read more about MRs in Drupal.org at https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...

Hope this helps (if I understood well your question),

Christopher Riley’s picture

I am missing the boat somewhere. I applied the needed patches or the ones that seem to still be needed and followed the details in #27 and when I view the current month I see the event (currently the event is every 14 days starting on Sunday April 4th continuing forever), however when I advance to the next month no entries are shown.

Suggestions?

joelpittet made their first commit to this issue’s fork.

waako made their first commit to this issue’s fork.

waako’s picture

Status: Needs work » Needs review

Patch from MR !6 worked for me with recurring date as contextual filter on Calendar view.

However, when viewing other calendar view using core datetime field, it threw
Error: Call to undefined method Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::getHelper() in Drupal\calendar\Plugin\views\row\Calendar->explodeValues() (line 592 of modules/contrib/calendar/src/Plugin/views/row/Calendar.php).

It appears that once date_recur module is installed, the check on line 530 (if ($this->dateRecurService->getOptionalDependency()) returns true for all field types, but missing the helper used on line 592, hence the error.
Added a check that field type is date_recur before assigning $event->recurring

Hope that makes sense, and is the correct approach.
New to the MR process, so apologies for the extra branch.

mei2020 made their first commit to this issue’s fork.

3CWebDev’s picture

On Drupal 9:

I've applied the merge request #6 patch along with patch #39 but recurring dates are still not showing up correctly for me. Only the first occurrence of a recurring date is displayed on the calendar and no further dates.

Besides applying the patch(es), are there any config changes or anything else that may need to be done to get recurring dates to display correctly?

It seems like people in the thread have had intermittent success and for those that got it to work was some time ago and most likely older versions of Calendar, Recurring Dates, and Drupal.

Has anyone had success with current versions?

johnv’s picture

Title: Support recurring dates in calendar » Support recurring dates in calendar 8.x-1.x
johnv’s picture

Title: Support recurring dates in calendar 8.x-1.x » Support Recurring Dates Field in Calendar 8.x-1.x