Documentation
¶
Overview ¶
Package calendar registers handlers of iCalendars, calendars of events and tasks, which return their events, which are searched for by when and where they are, a description of them in words, and their image as artwork
Index ¶
Constants ¶
const (
// Namespace is the namespace of the events of a calendar
Namespace = "ical"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
UID string `json:"uid,omitempty"`
Kind string `json:"kind"` // event, or task
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Location string `json:"location,omitempty"`
Start string `json:"start,omitempty"`
End string `json:"end,omitempty"`
Due string `json:"due,omitempty"` // when a task is due, as a date or an instant
Completed string `json:"completed,omitempty"` // when a task was completed, as an instant
Parent string `json:"parent,omitempty"` // the UID of a task's parent, of which it's a subtask
AllDay bool `json:"all_day,omitempty"`
TZ string `json:"tz,omitempty"` // the zone of a timed event, or UTC
NoYear bool `json:"no_year,omitempty"` // a yearly event whose first year isn't known, such as a birthday
RRule string `json:"rrule,omitempty"`
ExDate []string `json:"exdate,omitempty"`
RecurrenceID string `json:"recurrence_id,omitempty"`
URL string `json:"url,omitempty"`
Status string `json:"status,omitempty"`
Organizer string `json:"organizer,omitempty"`
Attendees []string `json:"attendees,omitempty"`
Categories []string `json:"categories,omitempty"`
// contains filtered or unexported fields
}
Event is an event, or a task, of an iCalendar, which is stored as ical:event. Its start and end are dates, as 2006-01-02, when it's all day, or instants in UTC, as RFC 3339, when it's timed, where the end is exclusive. A timed event in a zone is converted to UTC with its zone, and one without a zone, or in a zone which isn't known, is treated as UTC, and has no zone. A repeating event has its rule and the starts it excludes, as they're written, and an occurrence of it which is changed has the start it replaces as its recurrence ID. A task has when it's due.
type Occurrence ¶ added in v1.1.7
type Occurrence struct {
UID string
RecurrenceID string // As a date, 2006-01-02, or an instant, in UTC, of RFC 3339, as an Event's
Kind string
Title string
Start ical.Time
End ical.Time // Zero when it has none
TZ string
}
Occurrence is a time an event, or a task, occurs: its UID, and, of an event which repeats, its recurrence ID, the start it was to have, which identify it, as an event can be in more than one calendar, its kind, event or task, title, and when it starts, and, unless it's an instant, or a task, ends, which is exclusive, as dates, of an all-day event, or times, in UTC, and the zone of its times, such as Europe/Berlin, or none, of a date, or a time which is floating
func Occurrences ¶ added in v1.1.7
func Occurrences(events []Event, max int) []Occurrence
Occurrences returns the times the events occur, in order, the earliest max of them, or every one, when it's zero: an event, or a task, which starts when it's due, or else of its start, of its own, and each time an event which repeats occurs, of a rule which ends, of its UNTIL, or COUNT, without the starts it excludes, and those which another of the events, of the same UID, changes, of its recurrence ID, which is one of its own. An event which repeats forever, or whose rule can't be read, is its first time, as when it ends isn't known, and an event which is cancelled, or a yearly event whose year isn't known, such as a birthday, has none, as neither does an event without a start.