1

I have the following HTML calendar:

<h:inputText t:type="date" value="#{data.dueDate}">
    <f:convertDateTime pattern="yyyy-MM-dd"/>
</h:inputText>

How can I add the min attribute for this?

t refers to xmlns:t="http://xmlns.jcp.org/jsf/passthrough"

TylerH
  • 20,799
  • 66
  • 75
  • 101
tano9321
  • 31
  • 7

1 Answers1

1

With input type date you can use min and max attributes. You can set the min attribute the same way you used passthrough to set the type="date" attribute. So, for example:

<h:inputText t:type="date" t:min="2016-12-31" value="#{data.dueDate}">
  <f:convertDateTime pattern="yyyy-MM-dd"/>
</h:inputText>

See also:

Community
  • 1
  • 1
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102