Hi all,

Was looking for support for entities with unlimited dates.

Couldn't see any other issues regarding this, perhaps there is a reason for this having not been implemented?

I've created a patch for what I have so far, any suggestions would be great.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexgw created an issue. See original summary.

Mingsong’s picture

Thanks @alexgw for the patch.

If you could give a use case for this patch, such as the field type for each date field and settings, that would be great.

I am keen to have a look at it.

Cheers,

breezeweb’s picture

I'm testing the patch from @alexgw now. It seems to work with the Date Range field, with multiple values enabled. I've set the single field to be start & end date in the view settings.

Will let you know if I run into any issues.

breezeweb’s picture

alexgw’s picture

Correct, I should have mentioned on the first post.
The patch is intended to provide support for the Date Range field.

It was also hobbled together on short notice, so I may need to come back and clean it up a bit.

Use case
An event may span multiple days, with some irregularity (i.e. slightly different start, end times on a particular day, or missing a day entirely)

alexgw’s picture

Just noticed there is an issue with inline editing of events.

Visually, all events of the entity will move with the changes that you make. However, the date changes of the event will save correctly, and reloading the view reflects the changes.

Perhaps the best approach would be suffixing the ID of the event entries with the date field index (indices > 0 to avoid breaking current uses which reference the entry ID?)

From
'id' => $entity_id,

To
'id' => (!$i ? $entity_id : $entity_id . '_' . $i),

With the additional logic to handle this on updateEvent()

Mingsong’s picture

Regarding the Date range field, we have done some works on it.

Currently, we can select a daterange field for both the start and end date.

See #2952608: Support daterange fields

alexgw’s picture

True, but #2952608 only seems to support one set of start and end, on a Date range field. This approach aims to allow nth.

embeau’s picture

I require this functionality as well. I have a daterange field on an entity that can have unlimited values.

The patch from alexgw was not working as the code has since been updated.

I rerolled the patch from alexgw to work with the latest release (2.4) and have it working. However, the issue brought up in #6 is still not addressed. How would you suggest we go about dealing with that?

josip.rajkovic’s picture

I rerolled the patch from embeau, because the code was updated.
Update: This is a reroll for the 3.x@dev branch which is not active anymore.
Update 2: Ignore this patch, it is not relevant to any branch or state.

josip.rajkovic’s picture

This is a reroll for version 4.2.
Update: Ignore this patch, it is not relevant to 4.2 version.

josip.rajkovic’s picture

This is a new patch, which is fixing this issue in FullcalendarViewPreprocess.php and the patch is made against 8.x-4.2 version.

Mingsong’s picture

Thanks fellows for the patch, test and feedback.

Here is the patch based on all your works and fitting in 8.x-4.3.

  • Mingsong authored bc20e37 on 9.x-1.x
    Issue #3048219 by josip.rajkovic, alexgw, Mingsong, embeau, breezeweb:...
Mingsong’s picture

Status: Active » Patch (to be ported)
Issue tags: +9.x

Push into 9.x and release as the develop version.

Mingsong’s picture

Status: Patch (to be ported) » Fixed

Just noticed there is an issue with inline editing of events.

Visually, all events of the entity will move with the changes that you make. However, the date changes of the event will save correctly, and reloading the view reflects the changes.

Perhaps the best approach would be suffixing the ID of the event entries with the date field index (indices > 0 to avoid breaking current uses which reference the entry ID?)

The approach I take is to use the view row index and start date index as the event id.

See the codes here:
https://git.drupalcode.org/project/fullcalendar_view/commit/5bf870c

jsidigital’s picture

I too need Support for entities with multiple dates and am looking at using release 5.0.1 of fullcalendar_view.

Does this version support entities with unlimited/multiple dates or does it need a patch?

Thanks.

Mingsong’s picture

5.0.1 should support the multiple date for date range field.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

thronedigital’s picture

I don't believe 5.0.4 has this feature - or I am missing where to configure the multiple date types.