title: How to display a date in different patterns in JSF t:dataTable?
body: <p>I have the next data table in my page:</p>
  
  <pre><code>&lt;t:dataTable value="#{bean.listOfPersons}" var="current"&gt;
     &lt;t:column&gt;
        &lt;t:outputText value="#{current.birthdate}"&gt;
           &lt;f:converter pattern="dd/mm/yyyy HH:mm" type="date"/&gt;
        &lt;/t:outputText&gt;
     &lt;/t:column&gt;
  &lt;/t:dataTable&gt;
  </code></pre>
  
  <p><code>Person</code> is an object I created, and one of it's properties is birthdate.
  Now I wish to display the details of many persons in this <code>&lt;t:dateTable&gt;</code>, including the birthdate. As you can see, I choose to display the birthdate in <code>dd/mm/yyyy HH:mm</code> pattern, so I can see the time if known. Now, the problem is that some of the birthdates doesn't have a time (only date), and when the time is <code>null</code> in <code>java.util.Date</code>, the time is automatic 00:00. How can I display the birthdate in short pattern if time is unknown (only date), and the regular pattern when I know the time (date and time)?</p>
  
  <p>What happens now:</p>
  
  <pre><code>17/3/1994 5:56
  1/1/1991 00:00
  12/2/1990 17:53
  21/12/2012 00:00
  </code></pre>
  
  <p>What I want to see:</p>
  
  <pre><code>17/3/1994 5:56
  1/1/1991
  12/2/1990 17:53
  21/12/2012
  </code></pre>
  
  <p>Short pattern when time is unknown.</p>
  
  <hr>
  
  <p>This is what I'm writing in the page.xhtml:</p>
  
  <pre><code>&lt;t:outputText value="#{bean.date}"&gt;
  &lt;f:converter convertetId="myconverter" pattern="[some pattern]" timeZone="America/Chicago" type="date"&gt;
  &lt;/t:outputText&gt;
  </code></pre>
  
  <p>This is the converter:</p>
  
  <pre><code>public class MyConverter extends DateTimeConverter
  {
  @Override
  public String getAsString (FacesContext faces, UIComponent comp, Object obj)
  {
  this.setTimeZone(null);
  String result = super.getAsString(faces, comp, obj);
  // My converter here...
  return result;
  }
  
  @Override
  public void setTimeZone(TimeZone tz)
  {
  // Always setting my own time zone, no matter what.
  super.setTimeZone(TimeZone.getTimeZone("America/Chicago"));
  }
  }
  </code></pre>
  
  <p>Now, as you can see, I'm always setting the time zone myself on <code>getAsString</code> because
  somehow now the f:converter doesn't recognize it's attributes... know why?</p>