This would be similar to the already existing disableMobile, but it would disable the plugin if the browser natively supports the type="date" field of an input.
Basically, the plugin will become just a fallback in case the browser doesn't have a native date picker solution.
Possible code for checking if the browser supports type="date":
var isDateInputSupported = function(){
var elem = document.createElement('input');
elem.setAttribute('type','date');
elem.value = 'foo';
return (elem.type == 'date' && elem.value != 'foo');
}
if (!isDateInputSupported()) // or.. !Modernizr.inputtypes.date
$('input[type="date"]').datepicker();
This would be similar to the already existing
disableMobile
, but it would disable the plugin if the browser natively supports thetype="date"
field of an input.Basically, the plugin will become just a fallback in case the browser doesn't have a native date picker solution.
Possible code for checking if the browser supports
type="date"
:Source: https://developers.google.com/web/updates/2012/08/Quick-FAQs-on-input-type-date-in-Google-Chrome
Would you consider a PR for this?