utils.event.js

Recurrence Event mainly used in utils.scheduler.js but can also be used as a standalone feature.

Responsive image

Code

Action

ev1 = new UTILS.Event({ target: $('body'), popup: true, onSave: (Event) => { $('#event-result-1').text(Event.stringifyRule()).velocity('callout.flash'); Event.getBox().clean(); } }).show(); FREQ=WEEKLY;INTERVAL=1;BYDAY=WE;COUNT=1;DTSTART=2020-12-01T16:14:15Z

Inline Event

ev2 = new UTILS.Event({ target: $('#event-target-2'), popup: false, mode: 'compact', onSave: (Event) => { $('#event-result-2').text(Event.stringifyRule()).velocity('callout.flash'); }, onChange: (Event) => { Event._onSave(); } }).show();
FREQ=WEEKLY;INTERVAL=1;BYDAY=WE;COUNT=1;DTSTART=2020-12-01T16:14:15Z

API

Option

Required

Default

Description

target optional $('body') DOM elm where the event widget will be inserted ( only applicable if popup = true )
popup optional true Whether to open the event widget as a modal box
rule optional FREQ=WEEKLY; INTERVAL=1; BYDAY=WE; COUNT=1; DTSTART=2020-12-01T16:14:15Z Holds the rule in iCal format
start optional moment() Start date of the event
end optional null End date of the event
mode optional full

The mode of the event widget. Options are full or compact

Note, if compact mode is set, no save button will be shown

Methods

Method

Default

Repeat

Description

onShow null REPEAT Triggered when the event widget is shown
onHide null REPEAT Triggered when the event widget is getting hidden
onSave null REPEAT Triggered on save button getting clicked
onCancel null REPEAT Triggered when the event widget modal box is closed. ( only applicable if popup = true )
onRender null REPEAT Triggered on content getting rendered
onChange null REPEAT Triggered on any change within the event widget
Loading resources, please wait...