dakala / fullcalendar

Fork of Fullcalendar Drupal 8 module
3 stars 9 forks source link

JS API example #17

Open dkre opened 7 years ago

dkre commented 7 years ago

Hi Dakala,

Really appreciate the work you've done with this module port, it's made D8 calendar creation a breeze.

I'm hoping you can help me with a bit of guidance on how to create a js api plugin. I've used the api example and looked at the example used by fullcalendar_options but I still can't get any option to be applied or get a custom function to be used (specifically I'm looking to use jQuery date picker as a gotoDate and date range filter).

Here's a non-working example:

`(function($) {

Drupal.fullcalendar.plugins.mymodule = {

options: function (fullcalendar) { var settings = Drupal.settings.fullcalendar[fullcalendar.dom_id].mymodule; var options = $.extend( { header: { left: 'title', center: '', right: 'today prev,next' }, }, settings ); return options; }, };

}(jQuery));`

Any help you can provide would be greatly appreciated.

dakala commented 7 years ago

Thanks for this but we're still working on a port of the main module to Drupal 8 and Fullcalendar 3.x. It might take a while for this.

dkre commented 7 years ago

No worries at all.

If it helps for future development- the plugin settings are passed to library.js (Drupal.fullcalendar.plugins) but the settings aren't used.