calendar.editEvent()

Type Function
Return value none
Revision Release 2024.3703
Keywords calendar, event, edit, editEvent
See also calendar.*

Overview

calendar.editEvent() updates existing event with specified properties.

Syntax

calendar.editEvent( params )
params (required)

Table. Table containing call parameters - see next section for details.

Parameters table reference

listener (optional)

Listener. Listener that will receive event event.

eventId (required)

String. Identifier of calendar event to modify.

title (optional)

String. Title for the event.

startDate (optional)

Number. Start date for the event in Unix time format.

endDate (optional)

Number. End date for the event in Unix time format.

calendarId (optional)

String. Calendar identifier to move the calendar event.

Note
Changing calendar will probably change event's identifier.
location (optional)

String. Location for the event.

allDay (optional)

Boolean. Boolean value, where true means that the event should last all day and false otherwise.

repeatFrequency (optional)

String. Recurrency frequency for the event. Valid values are: day, week, month and year.

repeatEndDate (optional)

Number. Recurrency end date for the event in Unix time format.

alarms (optional)

Table. Lua array, each entry containing number of minutes before event to trigger an alarm.

Example

local calendar = require( "plugin.calendar" )

local function editEventListener( event )
    -- Handle events here
end

 -- retrieve event id from getEvents or addEvent
local someEventId = nil

-- Change event's title
calendar.editEvent(
{
    listener = editEventListener,
    eventId = someEventId,
    title = "Modified Test Event"
}
)