fullcalendar-copy-paste
v1.0.1
Published
The Plugin expands for FullCalendar, which aims to add copy and paste features using shortcuts.
Downloads
48
Maintainers
Readme
FullCalendar Copy-paste Plugin
The Plugin expands for FullCalendar, which aims to add copy and paste features using shortcuts.
Installation
- Install this library in your project.
npm i fullcalendar-copy-paste
- Use the plugin.
import copyPastePlugin from 'fullcalendar-copy-paste'
new Calendar(calendarEl, {
plugins: [copyPastePlugin],
height: "100%",
}
Configuration
Exp:
new Calendar(calendarEl, {
plugins: [copyPastePlugin],
height: "100%",
previewCopy: false,
eventCopy: (trigger) => {
const oldEvent = trigger.oldEvent;
const newEvent = trigger.event;
const type = trigger.type;
if (trigger.type === 'copy') {
// do something
} else if (trigger.type === 'cut') {
// do something
}
}
});
API:
API for external code:
window.calendarUtils.copy(element as HTMLElement)
window.calendarUtils.cut(element as HTMLElement);
Demo:
Copy:
Cut:
Duplicate:
Contributor: ToanNguyen