fullcalendar-copy-paste
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

FullCalendar Copy-paste Plugin

The Plugin expands for FullCalendar, which aims to add copy and paste features using shortcuts.

Actions Window Mac Description
Copy Ctrl + C Cmd + C Select event to copy.
Cut Ctrl + X Cmd + X Select event to cut.
Paste Ctrl + V Cmd + V Or you can press Enter or Click to paste.
Duplicate Ctrl + D Cmd + D Instantly clone an event.
Cancel ESC ESC Or click on the location outside the Calendar.

Installation

  1. Install this library in your project.
npm i fullcalendar-copy-paste

  1. Use the plugin.
import copyPastePlugin from 'fullcalendar-copy-paste'

new Calendar(calendarEl, {
  plugins: [copyPastePlugin],
  height: "100%",
}

Configuration

Fields Type Description
previewCopy Boolean Default: true, Set false if the u wants to catch the event without wanting the view to change.
eventCopy Callback Used when you want tho track changes of new and old events.

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:

Copy


Cut:

Copy


Duplicate:

Copy


Contributor: ToanNguyen

@Classfunc

Package Sidebar

Install

npm i fullcalendar-copy-paste

Weekly Downloads

18

Version

1.0.1

License

MIT

Unpacked Size

313 kB

Total Files

9

Last publish

Collaborators

  • toannv2