calendar

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocaleDefaultTag    = LocaleTag("en-US")
	LocaleTagChinese    = LocaleTag("zh-CN")
	LocaleTagFrench     = LocaleTag("fr-FR")
	LocaleTagGerman     = LocaleTag("de-DE")
	LocaleTagItalian    = LocaleTag("it-IT")
	LocaleTagJapanese   = LocaleTag("ja-JP")
	LocaleTagPortuguese = LocaleTag("pt-PT")
	LocaleTagSpanish    = LocaleTag("es-ES")
)
View Source
var (
	Sunday    = Day(0)
	Monday    = Day(1)
	Tuesday   = Day(2)
	Wednesday = Day(3)
	Thursday  = Day(4)
	Friday    = Day(5)
	Saturday  = Day(6)
)

Functions

func Calendar

func Calendar(props ...Props) templ.Component

func Script

func Script() templ.Component

Types

type Day

type Day int

type LocaleTag

type LocaleTag string

type Props

type Props struct {
	ID              string
	Class           string
	LocaleTag       LocaleTag
	Mode            SelectionMode // Optional: "single" (default) or "range".
	Value           *time.Time    // Selected date (single mode) or range start (range mode).
	EndValue        *time.Time    // Range end date (range mode only).
	Name            string        // Hidden input name for Value.
	EndName         string        // Hidden input name for EndValue. Defaults to Name + "-end".
	InitialMonth    int           // Optional: 0-11 (Default: current or from Value). Controls the initially displayed month view.
	InitialYear     int           // Optional: (Default: current or from Value). Controls the initially displayed year view.
	StartOfWeek     *Day          // Optional: 0-6 [Sun-Sat] (Default: 1).
	HideHiddenInput bool          // Optional: Hide the hidden input when a parent component owns form submission.
}

type SelectionMode

type SelectionMode string
const (
	SelectionModeSingle SelectionMode = "single"
	SelectionModeRange  SelectionMode = "range"
)

Jump to

Keyboard shortcuts

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