Type Function Return value none Revision Release 2024.3703 Keywords calendar, event, add, addEvent See also calendar.*
calendar.addEvent()
adds event with specified properties.
calendar.addEvent( params )
Table. Table containing call parameters - see next section for details.
String. Calendar identifier where calendar event should be added. Default calendar would be used if not specified.
String. Title for new calendar event.
Number. Start date for new calendar event in Unix time format.
Number. End date for new calendar event in Unix time format.
String. Location for new calendar event.
Boolean. Boolean value, where true
means that new calendar event should last all day and false
otherwise.
String. Recurrency frequency for new calendar event. Valid values are: day
, week
, month
and year
. This field must be combined with repeatEndDate
.
Number. Recurrency end date for new calendar event in Unix time format. This field must be combined with repeatFrequency
.
Table. Lua array, each entry containing number of minutes before event to trigger an alarm.
local calendar = require( "plugin.calendar" ) local unixTimeNow = os.time( os.date( '*t' ) ) local function addEventListener( event ) -- Handle events here end -- Add event with specified properties calendar.addEvent( { listener = addEventListener, title = "Test Event", startDate = unixTimeNow + 86400, endDate = unixTimeNow + 86400 + 3600, alarm = 30, repeatFrequency = "day", repeatEndDate = unixTimeNow + 604800 } )