How to make a date field containing only Month and Year Html

Asked

Viewed 3,898 times

2

I need a date field containing only Month and Year Html preference that enables on the screen something like a calendar containing only months and years.

Obs: I’m using Angularjs, javascript

2 answers

5


With HTML5 can use the type="month"

<input type="month">

Supported by browsers:

  • Chrome 20+
  • Edge 12
  • Opera 10.62+

-4

Create a select With the month Eos.

 <div class="mes">
   <select>
      <option>01</option>
      <option>02</option>
      <option>03</option>
      <option>04</option>
      <option>05</option>
      <option>06</option>
      <option>07</option>
      <option>08</option>
      <option>09</option>
      <option>10</option>
      <option>11</option>
      <option>12</option>
   </select>
</div>

<div class="ano">
   <select>
      <option>1990</option>
      <option>1991</option>
      <option>1992</option>
      <option>1993</option>
      <option>1994</option>
      <option>1995>/option>
      <option>1996</option>
      <option>1997</option>
      <option>1998</option>
      <option>1999</option>
      <option>2000</option>
      <option>2001</option>
   </select>
</div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.