title: Format date in <f:selectItem(s) itemLabel> using DateTimeConverter
body: <p>I have a <code>&lt;h:selectOneMenu&gt;</code> that has <code>&lt;f:selectItems&gt;</code> with <code>CategoryHistory</code> objects loaded in it. I only show the <code>Date date</code> field as <code>itemLabel</code>.
  That works but I want to format the date:
  I created a converter that extends <code>javax.faces.convert.DateTimeConverter</code> and change the fields in the constructor. But my dates only show in default format :(</p>
  
  <p><strong>DateAndTimeConverter.java</strong></p>
  
  <pre><code>import javax.faces.bean.ManagedBean;
  import javax.faces.convert.Converter;
  import javax.faces.convert.DateTimeConverter;
  import javax.faces.convert.FacesConverter;
  
  @FacesConverter(value = "dateAndTimeconverter")
  @ManagedBean
  public class DateAndTimeConverter extends DateTimeConverter implements Converter {
  
   public DateAndTimeConverter(){  
    this.setDateStyle("short");
   }
  </code></pre>
  
  <p><strong>xhtml</strong></p>
  
  <pre><code> &lt;h:selectOneMenu valueChangeListener="#{admin.categoryHistoryListener}"
      onchange="submit()" value="#{admin.categoryHistory.id}" converter="#{dateAndTimeconverter}"&gt;       
    &lt;f:selectItems value="#{admin.categoryHistories}" var="n"
       itemValue="#{n.id}" itemLabel="#{n.date}"&gt;
    &lt;/f:selectItems&gt;
   &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>It also doesn't work when I try:</p>
  
  <pre><code>&lt;h:selectOneMenu valueChangeListener="#{admin.categoryHistoryListener}"
      onchange="submit()" value="#{admin.categoryHistory.id}"&gt;
    &lt;f:converter converterId="dateAndTimeconverter"/&gt;       
    &lt;f:selectItems value="#{admin.categoryHistories}" var="n"
       itemValue="#{n.id}" itemLabel="#{n.date}"&gt;
    &lt;/f:selectItems&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p><strong>CategoryHistory</strong> Has a Date date, and Long id +...</p>
  
  <p>Thank you</p>