Documentation
¶
Overview ¶
Package calendarevents reads and writes the phone's calendars directly. To add one event, the calendar plugin is simpler and needs no permission: it opens the system's screen. This is for showing someone's calendar in your app, or keeping it in step with your server.
nimbus native plugin add calendar-events
if ok, _ := calendarevents.Request(ctx); ok {
id, err := calendarevents.Create(ctx, calendarevents.Event{Title: "Table for two", Start: at})
week, err := calendarevents.List(ctx, time.Now(), time.Now().AddDate(0, 0, 7))
}
Index ¶
- func Create(ctx context.Context, e Event) (string, error)
- func Delete(ctx context.Context, id string) error
- func DeleteCalendar(ctx context.Context, id string) error
- func NewCalendar(ctx context.Context, title string) (string, error)
- func Request(ctx context.Context) (bool, error)
- func Update(ctx context.Context, e Event) error
- type Calendar
- type Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCalendar ¶
DeleteCalendar removes a calendar and everything in it.
func NewCalendar ¶
NewCalendar makes a calendar of your own, kept on the phone: a good home for what your app adds.
Types ¶
type Calendar ¶
type Calendar struct {
ID string `json:"id"` // for Event.CalendarID
Title string `json:"title"` // its name
Writable bool `json:"writable"` // whether you can add to it
Default bool `json:"default"` // where new events go
}
Calendar is one of their calendars.
type Event ¶
type Event struct {
ID string // set by Create; leave it empty for a new one
CalendarID string // empty means the default calendar
Title string // its name
Location string // where; optional
Notes string // more detail; optional
Start time.Time // when it starts
End time.Time // the Start plus an hour when zero
AllDay bool // it has no time of day
}
Event is something in a calendar. A repeating event comes back once for each time it happens, all with the same ID.
Click to show internal directories.
Click to hide internal directories.