The <input> tag with a type="week"
attribute creates an input field that accepts a week and year value.
Inside this field is a calendar icon. Clicking this icon opens a week/year picker.
An <input> element of type week.
Clicking the calendar icon opens a week/year picker. Alternatively, enter a value directly into the field.
<form action="/tutorial/action.html">
<fieldset>
<legend>Select Week/Year</legend>
<input type="week" name="week"><br /><br />
<input type="submit" value="Submit">
</fieldset>
</form>
The <input type="week">
creates an input field that accepts week and year data.
Clicking the calendar icon inside the field will open a week/year picker.
The control's UI varies from browser to browser. Browser support is spotty.
The week field also accepts manual entry which follows a week and year format.
<input type="week">
Here is when type="week"
support started for each browser:
Chrome
|
25.0 | Feb 2013 |
Firefox
|
Not Supported | |
IE/Edge
|
12.0 | Jul 2015 |
Opera
|
10.1 | Jun 2009 |
Safari
|
Not Supported |
Back to <input>