1
0
mirror of https://github.com/axzilla/templui.git synced 2025-02-21 00:12:48 +00:00

fix: add data-date-format on datepicker to get correct format

This commit is contained in:
“axzilla” 2024-10-07 10:42:43 +02:00
parent 48d807ce6a
commit b17507a717
2 changed files with 3 additions and 4 deletions

View File

@ -44,10 +44,11 @@ type DatepickerProps struct {
// - Attributes: Additional HTML attributes to apply to the datepicker input element. Default: nil
templ Datepicker(props DatepickerProps) {
<div
data-date-format={ props.Format }
x-data="{
datePickerOpen: false,
datePickerValue: '',
datePickerFormat: '{ templ.EscapeString(props.Format) }',
datePickerFormat: $el.getAttribute('data-date-format'),
datePickerMonth: '',
datePickerYear: '',
datePickerDay: '',

View File

@ -1,8 +1,6 @@
package showcase
import (
"github.com/axzilla/goilerplate/internals/ui/components"
)
import "github.com/axzilla/goilerplate/internals/ui/components"
templ DatepickerShowcase() {
<div class="flex justify-center items-center border rounded-md py-16 px-4">