model

package
v0.0.0-...-b0f0f26 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

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

Day ...

func (Day) Events

func (d Day) Events() []Event

Events returns all events for that day.

func (Day) InMonth

func (d Day) InMonth(month Month) bool

InMonth tells, if the day is in the monath.

func (Day) IsToday

func (d Day) IsToday() bool

IsToday returns true, if this is the day.

func (Day) Number

func (d Day) Number() int

Number returns a number between 1 and 31.

type Event

type Event struct {
	Title    string
	Subtitle string
	// contains filtered or unexported fields
}

Event is shown in a day.

func LoadEvents

func LoadEvents() ([]Event, error)

LoadEvents loads all calendar events.

func (Event) Time

func (e Event) Time() string

Time returns the start time of the event.

type Model

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

Model holds the global data for the calendar.

func New

func New(location *time.Location, events []Event) *Model

New initializes a model.

func (Model) MonthFromAttr

func (m Model) MonthFromAttr(attr string) (Month, error)

MonthFromAttr returns a Month from an attr.

func (Model) ThisMonth

func (m Model) ThisMonth() Month

ThisMonth returns the current month.

type Month

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

Month represents one month.

func (Month) Attr

func (m Month) Attr() string

Attr returns a string representation of the month.

func (Month) Name

func (m Month) Name() string

Name returns a string representing the month.

func (Month) Next

func (m Month) Next() Month

Next returns the next month.

func (Month) Previous

func (m Month) Previous() Month

Previous returns the previous month.

func (Month) Weeks

func (m Month) Weeks() []Week

Weeks returns all weeks of the month.

type Week

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

Week ...

func (Week) Days

func (w Week) Days() []Day

Days returns the days of the month

Jump to

Keyboard shortcuts

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