4 ms·
Support for input type="date" can be tested by creating an element like that and checking the type attribute. But how can you tell if the browser has support fo
by ville 14y ago
Support for input type="date" can be tested by creating an element like that and checking the type attribute. But how can you tell if the browser has support for the native picker? You can't. That is why this picker takes the approach of changing the type date always to text to prevent double date pickers.
- petercooper 14y agoBut how can you tell if the browser has support for the native picker? You can't. That's what I was wondering. If there were a way, it'd be pretty awesome to use a library like this as a polyfill rather than as a separate thing you attach to text inputs.
- leh0n 14y agoYou can. Modernizr will tell you if the browser supports the native picker. http://modernizr.com/ http://modernizr.com/
- ville 14y agoIt doesn't tell that. From Modernizr wiki[0]: "webforms UI: datepicker, colorpicker UIs cannot be detected, only the associated constraint validation" [0]: https://github.com/Modernizr/Modernizr/wiki/Undetectables https://github.com/Modernizr/Modernizr/wiki/Undetectables