Attached patch should get the main module rolling (didn't touch colors, legend and GoogleCalendar).

It should be possible to move events between days, and change their start/duration time and have those settings persist.

By default it filters by date of all date fields added under 'FIELDS', it should be possible to add additional exposed filters (e.g. Tags) under 'FILTER CRITERIA' and be able to narrow events even further, if there are exposed filters defined it should not hide their widgets and 'Apply' button.

done:
- updated .js to be compatible with latest fullcalendar lib (3.0.1)
- changed AJAX update controller to support eventResize and added some validation to it
- added 'Date only' fields handling
- update views 'use ajax' code, account for no more 'date_select' widget and changed markup/classes
- minor: ".fc-button" was hardcoded, theme variable (this.tm) was badly set
- added rudimentary timezone handling (uses user's default, needs work, config?)

todo:
- 'data-editable' is hardcoded in src\Plugin\views\style\FullCalendar.php
- initial render of the view still gets all? events into html
- review 'options'/config changes between 1.x and 2.x/3.x of fullcalendar lib (https://fullcalendar.io/wiki/Upgrading-to-v2/)
- untangle $view->getExposedInput() / settings.fullcalendar_fields_count / options['fields']['date_field'] interactions in fullcalendar.views_execution.inc:fullcalendar_views_pre_view() and fullcalendar.ajax.js:Drupal.fullcalendar.fullcalendar.prototype.submitInit()
- check/fix sub modules

note:
- there is no view filter plugin for daterange, so no 'between' filter, use with patch from #2786577: The Views integration Datetime Range fields should extend the views integration for regular Datetime fields if you use daterange fields (rebuild core, flush caches, run updates, might need to re-edit the old views even after that)
- not sure 'between' is the way to go anyway, maybe custom filter will be needed for 'daterange' (end_value > min, value < max)
- jQuery selectors in Drupal.fullcalendar.fullcalendar.prototype.submitInit() might be a bit loose, but it seems there are no views specific classes in exposed widgets
- jQuery.fullCalendar() breaks chaining
- many parts of the code could use refactoring, commenting, plenty of old @todos

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tacituseu created an issue. See original summary.

tacituseu’s picture

Status: Active » Needs review
FileSize
28.68 KB
30.34 KB

Attaching 2 patches:
- 2828939-2-ajax-fix.patch requires: 2827950+2827939+2827936+2827930-combined.patch from #2827950: Call to undefined function l() in AJAX Update controller
- 2828939-2-ajax-fix-combined.patch should work against current HEAD

tacituseu’s picture

Issue summary: View changes
tacituseu’s picture

Updated for head changes

tacituseu’s picture

arosboro’s picture

Nice work @tacituseu. I've installed this patch and was able to configure a View. Library detection is not working on the most recent version of the jquery dependency. I get

FullCalendar plugin At least 1.5.0
You need to download the !fullcalendar and extract the entire contents of the archive into the /libraries folder of your server.

What library version were you using?

arosboro’s picture

Status: Needs review » Reviewed & tested by the community

I have tested and confirmed that the following composer patch applies and restores functionality as expected:

 "drupal/fullcalendar": {
        "Restore AJAX functionality":
        "https://www.drupal.org/files/issues/2828939-4-ajax-fix-combined.patch"
}

The following actions have been tested:

  • Calendar renders using JQuery UI theme
  • Change view between month, week, day, today
  • Navigate forward and backward
  • Two date fields although not using date-range with a single field
  • Change date using ajax updates both fields correctly
tacituseu’s picture

Patch is based on fullcalendar-8.x-1.x-dev (8.x-1.x in repository) and fullcalendar-3.0.1.
fullcalendar-8.x-1.0-alpha2 should not be used (or displayed on download page even) as it is 3 years old.

arosboro’s picture

Yes, I eventually figured that out, and have dev branch installed in my project. The library issue seemed to resolve itself.

arosboro’s picture

is anyone maintaining this project atm?

martin107’s picture

There are a few willing people lurking about, but I am afraid the answer seems to be No :)

tacituseu’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
29.27 KB

Left one drupalSettings.path.basePath in eventResize.

@arosboro: 'Looked at once in a full moon' would be the proper maintenance status :), at least on d.o., there's also a git repo, maybe new maintainer expects work to magically happen there, so far it is just a garden of empty issues.

tacituseu’s picture

Adds support for views with arguments.

tacituseu’s picture

- fixes 'Enable advanced time and date format settings' not being applied (ref: https://fullcalendar.io/docs/views/View-Specific-Options/).
- fixes #2853942: Libraries are not attached for plugins and upgrades fullcalendar_options

griddick’s picture

Great work tacituseu thanks!
I have just started playing with your changes against the latest 3.4.0 release of fullcalendar. One small extra change required due to deprecated methods.

tacituseu’s picture

@griddick: looking at the source of fullcalendar-3.4.0.zip even though those properties were deprecated, they are still kept there for backward compatibility, so it should work without those changes, might be worth keeping it compatible with all of 3.x vs only latest.

tacituseu’s picture

SocialNicheGuru’s picture

I can install the module with this patch using the dev version.

have not fully tested the functionality yet though.

tacituseu’s picture

There is some recent movement in github repo by @lonalore (see: https://github.com/dakala/fullcalendar/pull/22), you might want to check it out too.

brooke_heaton’s picture

This patch no longer applies clean for me.

NickDickinsonWilde’s picture

FileSize
40.35 KB

Rerolled

MrPaulDriver’s picture

Could not install patch 22

NickDickinsonWilde’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
tacituseu’s picture

Status: Needs work » Closed (outdated)

Latest dev has integrated an alternative patch provided by @lonalore over at github repo, so it should no longer be needed (didn't test it yet).

MrPaulDriver’s picture

Status: Closed (outdated) » Active

With respect, I don't think we can close this issue, marking it outdated, whilst it is causing problems right now. That there is a fix over at github does not mean it should not posted here.

tacituseu’s picture

@MrPaulDriver: The reason the patch doesn't apply is because the fix is no longer only at github, it was merged into latest 8.x-1.x-dev on D.O. (5ff71c7). Give it a try.

MrPaulDriver’s picture

Status: Active » Closed (outdated)

Understood. Thank you for the explanation.