package datepicker // DatePicker renders a reusable date picker component with DD/MM/YYYY format // // Features: // - Interactive calendar dropdown with month/year selectors // - DD/MM/YYYY format (proper date format, none of that American nonsense) // - Year range: 2001-2051 // - Today's date highlighted in blue // - Click outside to close // - Consistent with Catppuccin theme // // Parameters: // - id: unique ID for the input field (e.g., "start_date") // - name: form field name (e.g., "start_date") // - label: display label (e.g., "Start Date") // - placeholder: input placeholder (default: "DD/MM/YYYY") // - required: whether the field is required (true/false) // - onChange: Alpine.js expression to run when date changes (e.g., "dateIsEmpty = false; updateCanSubmit();") // Set to empty string "" if no custom onChange handler is needed // // Usage Example: // import "git.haelnorr.com/h/oslstats/internal/view/component/datepicker" // // @datepicker.DatePicker("birth_date", "birth_date", "Date of Birth", "DD/MM/YYYY", true, "handleDateChange();") // // The component submits the date in DD/MM/YYYY format. To parse on the server: // date, err := time.Parse("02/01/2006", dateString) templ DatePicker(id, name, label, placeholder string, required bool, onChange string) {