_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |// '.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
This is a polyfill for implementing the HTML5 <input type="week">
element in browsers that do not currently support it.
Using it is easy β simply include the week-polyfill.min.js
file in the HEAD of the HTML page.
You can then use <input type="week">
elements normally.
If the script detects that the browser doesn't support <input type="week">
, it will search for these elements and replace them with a jQuery UI datepicker to select the week. The week selection is stored in a hidden form field and submitted with the form in the standard format.
A default CSS file is provided. You may edit this file to style the input fields to make them look the way you want.
The script can also be called manually as a jQuery plugin for elements dynamically generated through script. Simply call the .inputWeek()
method on any jQuery object containing one or more <input type="week">
elements.
This script requires jQuery, jQuery UI, and Modernizr.