calendar.getEvents()

Type Function
Return value none
Revision Release 2024.3703
Keywords calendar, events, list, get, getEvents
See also calendar.*

Overview

calendar.getEvents() lists all available events for specified calendar.

Syntax

calendar.getEvents( params )
params (required)

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

Parameters table reference

listener (required)

Listener. Listener that will receive events event.

calendarId (optional)

String. An optional parameter to specify calendar to list events. If omitted, default calendar would be queried.

startDate (optional)

Number. An optional parameter to filter out event before this Unix time. If omitted, current date would be used.

endDate (optional)

Number. An optional parameter to filter out event after this Unix time. If omitted “distant future” would be used.

Example

local calendar = require( "plugin.calendar" )

local function listEventsListener( event )
    -- Handle resut in event.events here
end

-- List all available calendars
calendar.getEvents( { listener = listEventsListener } )