Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Modernizr for input type=datetime?

I made a custom build for HTML input fields & attributes and included that on my page in the <head> but that's not working. What else do I need to do?

like image 999
ztatic Avatar asked Aug 25 '11 20:08

ztatic


1 Answers

Not sure what it is you are trying to accomplish, but the "Input Attributes" option adds tests for the following <input> attributes: autocomplete, autofocus, list, placeholder, max, min, multiple, pattern, required, and step. -- Not sure what this has to do with <input type="datetime" ...> elements?

The "Input Types" option does adds tests for the following types of <input> elements: search, tel, url, email, datetime, date, month, week, time, datetime-local, number, range, and color.

However, from the documentation:

These (input) types can enable native datepickers, colorpickers, URL validation, and so on. If a browser doesn’t support a given type, it will be rendered as a text field. Modernizr cannot detect that date inputs create a datepicker, the color input create a colorpicker, and so on—it will detect that the input values are sanitized based on the spec.

In general, Modernizr doesn't "do" anything (besides the HTML5 shim), it just allows you to detect for the existence of modern features on the browser.

like image 83
ckittel Avatar answered Oct 30 '22 05:10

ckittel