Calendar
A date field component that allows users to enter and edit date.
Installation
Install the component
templui add calendarAdd the JavaScript to your layout
@calendar.Script()Call this template in your base layout file (e.g., in the <head> section).
API Reference
Calendar
Calendar component for date selection with internationalization support.
| Name | Type | Default |
|---|---|---|
Unique identifier for the calendar element. | | - |
Additional CSS classes to apply to the calendar. | | - |
Locale tag for internationalization. Options: 'en-US', 'zh-CN', 'fr-FR', 'de-DE', 'it-IT', 'ja-JP', 'pt-PT', 'es-ES'. | | |
Selected date value. Pointer to time.Time for optional selection. | | |
Name attribute for the hidden input field. | | - |
Initial month to display (0-11). Defaults to current month or Value's month. | | - |
Initial year to display. Defaults to current year or Value's year. | | - |
Optional start of week (0-6, Sun-Sat). When nil, defaults to Monday (1). Use calendar.Sunday through calendar.Saturday constants. | | |