calendar

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, contentName string, args *Args, w *wasm.Wasm, options ...component.Option) (*component.Gear, error)

New constructs a new component that shows a calendar.

Types

type Args

type Args struct {
	// CSSPath is the path to location our css file for the calendar. If left empty
	// this will default to "/static/components/calendar/calendar.css", which is likely
	// incorrect for your application.
	CSSPath string

	// Month is the month the calendar represents.
	Month time.Month

	// Year is the year the calendar represents.
	Year int

	// DayFunc is called while building the calendar for a month. The function
	// here returns information that is used to determines how a day is displayed
	// and what
	DayFunc func(month time.Month, day, year int) Day

	// MonthArrows indciate that you want arrows that move the calendar one
	// month forward or one month backwards.
	MonthArrows bool

	// FutureTime indicates that we can display times ahead of the current time.
	FutureMonths bool
}

Args are arguments about how to setup our calendar.

type Day

type Day struct {
	// IsSelected says this day is marked as individually selected.
	IsSelected bool
	// Highlighted indicates this day is highlighted in the current calendar time.
	// This is often used to mark that this is the current day or sometimes several
	// are highlighted to show a selected week or when events occur.
	Highlighted bool
	// OnClick is the function to call when this day is clicked. If this is not set,
	// then the Day will be non-clickable. This function will receive a DayEventArgs
	// as its "arg" argument.
	OnClick WasmFunc
}

Day represents things about a calendar day.

type DayEventArgs

type DayEventArgs struct {
	Month time.Month
	Day   int
	Year  int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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