- Issue created by @Nchase
- Status changed to Needs work
3 months ago 10:46am 15 January 2025 - 🇫🇮Finland Nchase
Same on a fresh Drupal 11 installation. Additionally I get an error when adding events via admin/bat/events/event/add/availability_daily
- First commit to issue fork.
- Merge request !22Issue #3481158 by nchase: Neither timeline nor month view is showing up in node - fix last $.once → (Open) created by dlevchik
- 🇵🇱Poland dlevchik Poznan, Poland
This was the last jQuery.once left since Drupal 10 update. Moved it to core/once function
- 🇮🇹Italy afagioli Rome
This issue is being worked on latest dev, with a more recent Fullcalendar version
Please do not timeline view is now only available with commercial license - 🇮🇹Italy afagioli Rome
In latest 11.1.x we have now a more recent Fullcalendar version.
Fullcalendar Timeline may require a Premium release. See https://fullcalendar.io/license
- Status changed to Needs review
22 days ago 8:54am 28 March 2025 - 🇫🇮Finland Nchase
Ok, So it seems like the bat_calendar_reference.js is
$('.cal').once().each(function () { var lastSource; var cal_id = $(this).attr('id'); $(this).fullCalendar({
which when changed to something like
once('bat-calendar', '.cal', context).forEach(function (el) { var lastSource; var cal_id = $(this).attr('id'); $(el).fullCalendar({
solves the JS error in the console but then all the settings from /admin/bat/config/fullcalendar are not read
In order to just see if it works I hardcoded the options:
(function ($, Drupal, once) { Drupal.behaviors.bat_calendar_reference = { attach: function (context) { const businessHours = { startTime: '00:00', endTime: '24:00', daysOfWeek: [0, 1, 2, 3, 4, 5, 6], }; once('bat-calendar', '.cal', context).forEach(function (el) { $(el).fullCalendar({ schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source', themeSystem: 'standard', locale: 'en', editable: false, selectable: false, nowIndicator: true, businessHours: businessHours, initialView: 'dayGridMonth', // or 'timeGridWeek', etc. events: [], // will be filled automatically if Views integration is working }); }); } }; })(jQuery, Drupal, once);
and now the Calendar is visible. Could it be that In Drupal 10+, once is an ES6 utility and not part of jQuery?
- 🇮🇹Italy afagioli Rome
Currently working on this, with events produced by bat_api
Thanks for contributing.