Add a custom validator looking for {required,checked}={true,false} attributes. This found numerous cases. Add an html_attrs method that handles required/checked attributes properly, skipping them if the value is false, and using them without a value if the value is true. Change all attribute handling to use html_attrs to fix the issue.
18 lines
414 B
Plaintext
18 lines
414 B
Plaintext
<%# locals: (name: nil, label: nil, default_date: nil, min_date: nil, max_date: nil) %>
|
|
<% @enable_datepicker = true %>
|
|
|
|
<%== part(
|
|
"components/form/text",
|
|
label: label,
|
|
name: name,
|
|
extra_class: "datepicker",
|
|
attributes: {
|
|
required: true,
|
|
placeholder: "YYYY-MM-DD HH:MM",
|
|
"data-maxDate": max_date,
|
|
"data-minDate": min_date,
|
|
"data-defaultDate": default_date,
|
|
hidden: true
|
|
}
|
|
) %>
|