title: How to display a month-year dropdown in Symfony2
body: <p>In my application, the user hsa to give a date by only selecting a month and a year in two dropdown lists. How can I achieve that? </p>
  
  <p>Here is what I've tried so far :</p>
  
  <p>In my Form :</p>
  
  <pre><code>$builder-&gt;add('date1', 'date', array(
   'widget'      =&gt; 'choice',
   'empty_value' =&gt; '',
   'format'      =&gt; 'MMMM-yyyy',
   'input'       =&gt; 'datetime',
   'years'       =&gt; range(date('Y'), date('Y') - 30, -1)
  )
  </code></pre>
  
  <p>which actually works and displays it exactly as I want but when validating the form, I get an error :  </p>
  
  <pre><code>This value is not valid
  </code></pre>
  
  <p>A screenshot of the wanted result :</p>
  
  <p><img src="https://i.stack.imgur.com/uvuG5.png" alt="Screenshot"></p>