Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="https://stackoverflow.com/users/11996/ben-koehler">Ben Koehler</a> from <a href="https://stackoverflow.com/questions/2208480/jquery-date-picker-to-show-month-year-only">this equivalent question</a> offers a jquery ui hack that works decently. Quoted here for convenience, all credit is his.</p> <p><a href="http://jsfiddle.net/yLjDH/" rel="nofollow noreferrer">JSFiddle of this solution</a></p> <p>-- Here's a hack (updated with entire .html file):</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css"&gt; &lt;script type="text/javascript"&gt; $(function() { $('.date-picker').datepicker( { changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'MM yy', onClose: function(dateText, inst) { var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $(this).datepicker('setDate', new Date(year, month, 1)); } }); }); &lt;/script&gt; &lt;style&gt; .ui-datepicker-calendar { display: none; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;label for="startDate"&gt;Date :&lt;/label&gt; &lt;input name="startDate" id="startDate" class="date-picker" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload