Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#13 | fullcalendar_view-3048219-13.patch | 10.94 KB | Mingsong |
#12 | entities-multiple-dates-3048219-12.patch | 11.23 KB | josip.rajkovic |
#11 | entities-multiple-dates-3048219-11.patch | 15.32 KB | josip.rajkovic |
#10 | entities-multiple-dates-3048219-10.patch | 20.07 KB | josip.rajkovic |
#9 | entities-multiple-dates-3048219-9.patch | 4.84 KB | embeau |
Comments
Comment #2
MingsongThanks @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,
Comment #3
breezeweb CreditAttribution: breezeweb commentedI'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.
Comment #4
breezeweb CreditAttribution: breezeweb commentedComment #5
alexgw CreditAttribution: alexgw commentedCorrect, 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)
Comment #6
alexgw CreditAttribution: alexgw commentedJust 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()
Comment #7
MingsongRegarding 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
Comment #8
alexgw CreditAttribution: alexgw commentedTrue, but #2952608 only seems to support one set of start and end, on a Date range field. This approach aims to allow nth.
Comment #9
embeau CreditAttribution: embeau at Aptitude Digital commentedI 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?
Comment #10
josip.rajkovic CreditAttribution: josip.rajkovic at Agiledrop - Your Trusted Drupal Teammates commentedI 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.
Comment #11
josip.rajkovic CreditAttribution: josip.rajkovic at Agiledrop - Your Trusted Drupal Teammates commentedThis is a reroll for version 4.2.Update: Ignore this patch, it is not relevant to 4.2 version.
Comment #12
josip.rajkovic CreditAttribution: josip.rajkovic at Agiledrop - Your Trusted Drupal Teammates commentedThis is a new patch, which is fixing this issue in FullcalendarViewPreprocess.php and the patch is made against 8.x-4.2 version.
Comment #13
MingsongThanks fellows for the patch, test and feedback.
Here is the patch based on all your works and fitting in 8.x-4.3.
Comment #15
MingsongPush into 9.x and release as the develop version.
Comment #16
MingsongThe 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
Comment #17
jsidigital CreditAttribution: jsidigital commentedI 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.
Comment #18
Mingsong5.0.1 should support the multiple date for date range field.
Comment #20
thronedigital CreditAttribution: thronedigital commentedI don't believe 5.0.4 has this feature - or I am missing where to configure the multiple date types.