title: Split java.util.Date over two h:inputText fields representing hour and minute with f:convertDateTime
body: <p>I would like to set up a Date field in my page like this</p>
  
  <pre><code>|hours| h |minutes|
  </code></pre>
  
  <p>where hours and minutes are in separated inputText.</p>
  
  <p>The bean have this date</p>
  
  <pre><code>import java.util.Date;
  ...
  private Date myDate;
  ...
  </code></pre>
  
  <p>and the page is</p>
  
  <pre><code>&lt;h:form&gt;
      ...
      &lt;h:inputText id="myDateHours" maxlength="2" value="#{myBean.myDate}"
          &lt;f:convertDateTime pattern="HH" /&gt;
      &lt;/h:inputText&gt;
  
      &lt;h:outputText value=" h " /&gt;
  
      &lt;h:inputText id="myDateMinutes" maxlength="2" value="#{myBean.myDate}"
          &lt;f:convertDateTime pattern="mm" /&gt;
      &lt;/h:inputText&gt;
      ...
  &lt;/h:form&gt;
  </code></pre>
  
  <p>But the problem is that when I submit the form only the last element is saved.
  For instance if I type the hours and then the minutes, the hours are overwritten and the result is</p>
  
  <pre><code>| 00 | h | minutes |
  </code></pre>
  
  <p>I tried to set</p>
  
  <pre><code>&lt;h:inputText id="myDateHours" value="#{myBean.myDate.hours}&gt;&lt;/h:inputText&gt;
  
  &lt;h:inputText id="myDateMinutes" value="#{myBean.myDate.minutes}&gt;&lt;/h:inputText&gt;
  </code></pre>
  
  <p>but I get a </p>
  
  <pre><code>Cannot convert 01/01/70 01:00 of type class java.util.Date to int
  </code></pre>
  
  <p>I don't want to replace my date field with two int field (hours and minutes...)
  Do you have an idea?</p>
  
  <p>Thanks</p>