FullCalendar Scheduler Extension (Vaadin 10)
FullCalendar Scheduler extension
FullCalendar Scheduler extension
This addon extends the FullCalendar integration addon with the FullCalendar Scheduler (v1.9.4) as Flow component for Vaadin Platform / Vaadin 10+.
It needs the FC integration addon (1.9.0+) as basis (https://vaadin.com/directory/component/full-calendar-web-component-vaadin10). Since this addon is not always updated when the basis gets an update, I would suggest, that you add both dependencies (basis and extension) to always use the latest version of basis. This extension is compatible as long as the readme does not tells anything else.
For information about the Schedular (functionality, features, license information, etc.) visit https://fullcalendar.io/scheduler.
License information:
Please be aware, that the Scheduler has a different license model then the FullCalendar. For details of when to use which license, visit https://fullcalendar.io/scheduler/license.
This addon does not provide any commercial license for the Scheduler. The license model of MIT does only affect the additional files of this addon, not the used original files.
Activating the Scheduler
By default the scheduler is not active, when you use a FullCalendar instance. To have an instance with scheduler
activated, use the withScheduler()
method of the FullCalendarBuilder
.
This method will throw an exception, if the scheduler extension is not on the class path.
To link a resource with entries, use the Entry subclass ResourceEntry
.
Additional Features of the Scheduler extension
- Activation of the Scheduler by method in the FullCalendarBuilder.
- Adding resources to a calendar (hierarchies of resources are not yet supported).
- Link one or multiple resources with entries.
- List of possible Scheduler based views (timeline).
Info: Entries are linked to calendar internally. The calendar instance is used to resolve resources by after updating an entry on the client side.
Feedback and co.
If there are bugs or you need more features (and I'm not fast enough) feel free to contribute on GitHub. :) I'm also happy for feedback or suggestions about improvements.
Sample code
FullCalendar calendar = FullCalendarBuilder.create().withScheduler().build(); // scheduler options ((Scheduler) calendar).setSchedulerLicenseKey(...);
Resource resource = new Resource(null, s, color); calendar.addResource(resource); // When we want to link an entry with a resource, we need to use ResourceEntry // (a subclass of Entry) ResourceEntry entry = new ResourceEntry(null, title, start.atStartOfDay(), start.plusDays(days).atStartOfDay(), true, true, color, "Some description..."); entry.setResource(resource); calendar.addEntry(entry);
calendar.addEntryDroppedListener(event -> { event.applyChangesOnEntry(); Entry entry = event.getEntry(); if(entry instanceof ResourceEntry) { Set<Resource> resources = ((ResourceEntry) entry).getResources(); if(!resources.isEmpty()) { // do something with the resource info } } });
calendar.changeView(SchedulerView.TIMELINE_DAY);
calendar.setGroupEntriesBy(GroupEntriesBy.RESOURCE_DATE);
1. Copy the styles_scheduler.html from the github demo or create your own custom style file and place it in your applications webapp/frontend folder (e. g. webapp/frontend /styles/styles/my-custom-full-calendar-styles.html) The github demo file can be obtained from here: https://github.com/stefanuebe/vaadin_fullcalendar/blob /master/demo/src/main/webapp/frontend/styles_scheduler.html 2. Modify the styles as needed. <custom-style> <style> html{ --fc-timeline_fc-divider-border-style: dashed; --fc-timeline_fc-divider-width: 2px; } </style> </custom-style> 3. Use the styles file in your application. @HtmlImport("frontend://styles/full-calendar-styles-scheduler.html") public class FullCalendarApplication extends Div { // ... }
ResourceEntry entry = new ResourceEntry(); // ... setup entry details, including addResource() entry.setRenderingMode(Entry.RenderingMode.BACKGROUND); calendar.addEntry(entry);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Fixed issues with removing resources
- removeAllResources now uses an internal calendar method instead of calling a non existing client side method
- resources removal now also removes the reference from the entries.
- Released
- 2019-10-08
- Maturity
- STABLE
- License
- MIT License
Compatibility
- Framework
- Vaadin 10
- Vaadin 10+
- Vaadin 11
- Vaadin 11+
- Vaadin 12
- Vaadin 13
- Vaadin 12+ in 1.2.1
- Browser
- Firefox
- Opera
- Safari
- Google Chrome
- iOS Browser
- Android Browser
- Windows Phone
- Microsoft Edge
FullCalendar Scheduler Extension (Vaadin 10) - Vaadin Add-on Directory
FullCalendar Scheduler extensionSource Code
Online Demo
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.0
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.1
- Fixed version for usage in a Vaadin application in production mode.
- Added api for setting group entries by option
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.2
FullCalendarScheduler constructors are now protected instead of package-private for being extensible.
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.3
Updated dependeny to FC basic 1.4.0. Smaller internal refactorings / cleanups.
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.4
Internal API changes in FC basis. Updated dependency.
FullCalendar Scheduler Extension (Vaadin 10) version 1.0.5
Added a workaround for https://github.com/stefanuebe/vaadin_fullcalendar/issues/8 and https://github.com/vaadin/flow/issues/4755.
FullCalendar Scheduler Extension (Vaadin 10) version 1.1.0
Added timezone support.
Please refer to the FC basis addon for details about usage of timezones.
FullCalendar Scheduler Extension (Vaadin 10) version 1.2.0
Added batch methods for adding / updating / removing entries and resources.
Thanks to **Martin Israelsen** for the support at this version. :)
FullCalendar Scheduler Extension (Vaadin 10) version 1.2.1
Updated basic dependency to 1.7.1
FullCalendar Scheduler Extension (Vaadin 10) version 1.2.2
Contains a fix for an error in ResourceEntry that provokes an exception when entry is removed from calendar. Thanks to "kevinGld".
FullCalendar Scheduler Extension (Vaadin 10) version 1.3.0
New event types for day click and select, that provide information about selected resources (if in resource information is available, e. g. in timeline view).
FullCalendar Scheduler Extension (Vaadin 10) version 1.3.1
- updated FC addon dependency to 1.9.0
- set constructors visibility to public
FullCalendar Scheduler Extension (Vaadin 10) version 1.3.2
Fixed issues with removing resources
- removeAllResources now uses an internal calendar method instead of calling a non existing client side method
- resources removal now also removes the reference from the entries.