
org.grails.scaffolding.registry.input.DateInputRenderer.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fields Show documentation
Show all versions of fields Show documentation
Fields integration for Grails
The newest version!
package org.grails.scaffolding.registry.input
import org.grails.scaffolding.model.property.DomainProperty
import org.grails.scaffolding.registry.DomainInputRenderer
/**
* The default renderer for rendering date properties
*
* @author James Kleeh
*/
class DateInputRenderer implements DomainInputRenderer {
@Override
boolean supports(DomainProperty property) {
property.type in [Date, Calendar, java.sql.Date]
}
@Override
Closure renderInput(Map defaultAttributes, DomainProperty property) {
defaultAttributes.type = "date"
defaultAttributes.placeholder = "YYYY-MM-DD"
return { ->
input(defaultAttributes)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy