calendar

package
v1.0.260758 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemindAt

func RemindAt(ev Event, lead time.Duration) time.Time

RemindAt is when a reminder should fire for an event.

func StorePath

func StorePath() string

StorePath is the local events JSON file.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is a month-view calendar with local events.

func New

func New(cfg config.Config) *App

New builds a Calendar bound to cfg — specifically cfg.Calendar.Accounts, to know what (if anything) to sync. Account setup itself (connect flow, enable/disable, lead time, timezone) lives in Settings → Calendar, not here; Calendar only ever reads config, it never writes it.

func (*App) Close

func (a *App) Close() error

func (*App) Draw

func (a *App) Draw(cv *uiapp.Canvas) error

func (*App) Handle

func (a *App) Handle(e uiapp.Event) error

func (*App) Init

func (a *App) Init(ctx *uiapp.Context) error

type DueReminder

type DueReminder struct {
	Event Event
	At    time.Time
}

DueReminder is an event whose reminder window is active now.

func DueReminders

func DueReminders(now time.Time, lead time.Duration, already map[string]time.Time) []DueReminder

DueReminders returns events that should notify now and have not been marked in `already` for today's reminder slot.

type Event

type Event struct {
	ID     string    `json:"id"`
	Title  string    `json:"title"`
	Start  time.Time `json:"start"`
	End    time.Time `json:"end"`
	AllDay bool      `json:"all_day"`
	Notes  string    `json:"notes,omitempty"`
	Source string    `json:"source"`
}

Event is a local calendar event.

func LoadEvents

func LoadEvents() []Event

LoadEvents reads local calendar events (best-effort).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL